aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/python/tutorial/pgtools.pyc
diff options
context:
space:
mode:
authorPeter Geoghegan <pg@bowt.ie>2025-06-06 10:19:44 -0400
committerPeter Geoghegan <pg@bowt.ie>2025-06-06 10:19:44 -0400
commite6eed40e44419e3268d01fe0d2daec08a7df68f7 (patch)
tree6895e05e740c6c192b1102d60af5ac12dd987084 /src/interfaces/python/tutorial/pgtools.pyc
parent016e407f4ba10b230f5094c9ba36a1df3d34fb22 (diff)
downloadpostgresql-e6eed40e44419e3268d01fe0d2daec08a7df68f7.tar.gz
postgresql-e6eed40e44419e3268d01fe0d2daec08a7df68f7.zip
Avoid BufferGetLSNAtomic() calls during nbtree scans.
Delay calling BufferGetLSNAtomic() until we finish reading a page that actually contains items that btgettuple will return to the executor. This reduces the number of calls during plain index scans (we'll only call BufferGetLSNAtomic() when _bt_readpage returns true), and totally eliminates calls during index-only scans, bitmap index scans, and plain index scans of an unlogged relation. Currently, when checksums (or wal_log_hints) are enabled, acquiring a page's LSN in BufferGetLSNAtomic() involves locking the buffer header (which involves the use of spinlocks). Testing has shown that enabling page-level checksums causes large regressions with certain workloads, especially on larger multi-socket systems. The regression isn't tied to any Postgres 18 commit. However, Postgres 18 commit 04bec894 made initdb use checksums by default, so it seems prudent to address the problem now. Author: Peter Geoghegan <pg@bowt.ie> Reviewed-By: Tomas Vondra <tomas@vondra.me> Discussion: https://postgr.es/m/941f0190-e3c6-4622-9ac7-c04e936e5fdb@vondra.me Discussion: https://postgr.es/m/CAH2-Wzk-Dg5XWs_jDuiHt4_7ryrSY+n=vxmHY51EVqPDFsKXmg@mail.gmail.com
Diffstat (limited to 'src/interfaces/python/tutorial/pgtools.pyc')
0 files changed, 0 insertions, 0 deletions