postgresql/src/include/access
Andres Freund 623a9ba79b snapshot scalability: cache snapshots using a xact completion counter.
Previous commits made it faster/more scalable to compute snapshots. But not
building a snapshot is still faster. Now that GetSnapshotData() does not
maintain RecentGlobal* anymore, that is actually not too hard:

This commit introduces xactCompletionCount, which tracks the number of
top-level transactions with xids (i.e. which may have modified the database)
that completed in some form since the start of the server.

We can avoid rebuilding the snapshot's contents whenever the current
xactCompletionCount is the same as it was when the snapshot was
originally built.  Currently this check happens while holding
ProcArrayLock. While it's likely possible to perform the check without
acquiring ProcArrayLock, it seems better to do that separately /
later, some careful analysis is required. Even with the lock this is a
significant win on its own.

On a smaller two socket machine this gains another ~1.03x, on a larger
machine the effect is roughly double (earlier patch version tested
though).  If we were able to safely avoid the lock there'd be another
significant gain on top of that.

Author: Andres Freund <andres@anarazel.de>
Reviewed-By: Robert Haas <robertmhaas@gmail.com>
Reviewed-By: Thomas Munro <thomas.munro@gmail.com>
Reviewed-By: David Rowley <dgrowleyml@gmail.com>
Discussion: https://postgr.es/m/20200301083601.ews6hz5dduc3w2se@alap3.anarazel.de
2020-08-17 21:08:30 -07:00
..
amapi.h Invent "amadjustmembers" AM method for validating opclass members. 2020-08-01 17:12:47 -04:00
amvalidate.h Invent "amadjustmembers" AM method for validating opclass members. 2020-08-01 17:12:47 -04:00
attmap.h Fix assorted typos 2020-03-31 16:00:06 +02:00
attnum.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
brin.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
brin_internal.h Implement operator class parameters 2020-03-30 19:17:23 +03:00
brin_page.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
brin_pageops.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
brin_revmap.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
brin_tuple.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
brin_xlog.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
bufmask.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
clog.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
commit_ts.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
detoast.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
genam.h Implement operator class parameters 2020-03-30 19:17:23 +03:00
generic_xlog.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
gin.h Implement operator class parameters 2020-03-30 19:17:23 +03:00
gin_private.h Invent "amadjustmembers" AM method for validating opclass members. 2020-08-01 17:12:47 -04:00
ginblock.h snapshot scalability: Don't compute global horizons while building snapshots. 2020-08-12 16:03:49 -07:00
ginxlog.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
gist.h Implement operator class parameters 2020-03-30 19:17:23 +03:00
gist_private.h Invent "amadjustmembers" AM method for validating opclass members. 2020-08-01 17:12:47 -04:00
gistscan.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
gistxlog.h Skip WAL for new relfilenodes, under wal_level=minimal. 2020-04-04 12:25:34 -07:00
hash.h Invent "amadjustmembers" AM method for validating opclass members. 2020-08-01 17:12:47 -04:00
hash_xlog.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
heapam.h snapshot scalability: Don't compute global horizons while building snapshots. 2020-08-12 16:03:49 -07:00
heapam_xlog.h Implement streaming mode in ReorderBuffer. 2020-08-08 07:47:06 +05:30
heaptoast.h tableam: New callback relation_fetch_toast_slice. 2020-01-07 14:36:38 -05:00
hio.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
htup.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
htup_details.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
itup.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
multixact.h Rename SLRU structures and associated LWLocks. 2020-05-15 14:28:25 -04:00
nbtree.h Invent "amadjustmembers" AM method for validating opclass members. 2020-08-01 17:12:47 -04:00
nbtxlog.h Adjust "root of to-be-deleted subtree" function. 2020-05-11 11:01:07 -07:00
parallel.h Allow vacuum command to process indexes in parallel. 2020-01-20 07:57:49 +05:30
printsimple.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
printtup.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
relation.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
reloptions.h Implement operator class parameters 2020-03-30 19:17:23 +03:00
relscan.h Allocate consecutive blocks during parallel seqscans 2020-07-26 21:02:45 +12:00
rewriteheap.h Skip WAL for new relfilenodes, under wal_level=minimal. 2020-04-04 12:25:34 -07:00
rmgr.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
rmgrlist.h Add deduplication to nbtree. 2020-02-26 13:05:30 -08:00
sdir.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
session.h Fix typo. 2020-01-13 14:44:55 +05:30
skey.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
slru.h Improve management of SLRU statistics collection. 2020-05-13 13:08:23 -04:00
spgist.h Invent "amadjustmembers" AM method for validating opclass members. 2020-08-01 17:12:47 -04:00
spgist_private.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
spgxlog.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
stratnum.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
subtrans.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
syncscan.h Move syncscan.c to src/backend/access/common. 2020-07-29 16:59:33 +12:00
sysattr.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
table.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
tableam.h Implement streaming mode in ReorderBuffer. 2020-08-08 07:47:06 +05:30
timeline.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
toast_helper.h Introduce macros for typalign and typstorage constants. 2020-03-04 10:34:25 -05:00
toast_internals.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
transam.h snapshot scalability: cache snapshots using a xact completion counter. 2020-08-17 21:08:30 -07:00
tsmapi.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
tupconvert.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
tupdesc.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
tupdesc_details.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
tupmacs.h Introduce macros for typalign and typstorage constants. 2020-03-04 10:34:25 -05:00
twophase.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
twophase_rmgr.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
valid.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
visibilitymap.h Initial pgindent and pgperltidy run for v13. 2020-05-14 13:06:50 -04:00
xact.h Make xact.h usable in frontend. 2020-08-17 10:50:13 +03:00
xlog.h Remove non-fast promotion. 2020-07-29 21:24:26 +09:00
xlog_internal.h Correct several behavior descriptions in comments. 2020-08-15 20:21:52 -07:00
xlogarchive.h Move routine definitions of xlogarchive.c to a new header file 2020-03-31 15:33:04 +09:00
xlogdefs.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
xloginsert.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
xlogreader.h Immediately WAL-log subtransaction and top-level XID association. 2020-07-20 08:48:26 +05:30
xlogrecord.h Immediately WAL-log subtransaction and top-level XID association. 2020-07-20 08:48:26 +05:30
xlogutils.h Adjust walsender usage of xlogreader, simplify APIs 2020-05-13 12:17:08 -04:00