4 ms·
They specifically mentioned using it for read queries, where transactions are irrelevant and waste bandwidth and processing power on both the server and the cli
by nuclear_eclipse 14y ago
They specifically mentioned using it for read queries, where transactions are irrelevant and waste bandwidth and processing power on both the server and the client.
- fusiongyro 14y agoThey're not irrelevant if you have parallel users modifying the database. The integrity checks in particular are only guarantee a coherent snapshot during a transaction, so if you do two queries and someone sneaks in a modification between them you'll get an incoherent snapshot. Whether or not this matters will depend on what sort of aggregate data you're creating. The cost of a short-lived read transaction is incredibly low, especially with Postgres. All the data for the last so many transactions will be in the database anyway until a vacuum happens. There's no CPU cost to read transactions that I'm aware of.
- jcdavis 14y agoInstagram is heavily sharded, so they've pretty much already given up a snapshot view of all their data anyways.
- fusiongyro 14y agoOh, I trust they understand what they're up to. It's just not advice everybody should follow blindly.
- jpitz 14y agoTransactions are most certainly not irrelevant for reads. They are quite necessary. Explicit transaction blocks for single-statement reads are pointless. Extra packets for the transaction demarcation even more so.