summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorAndres Freund2020-04-08 00:36:23 +0000
committerAndres Freund2020-04-08 00:36:23 +0000
commit75848bc74411130ede23995d0ab1aefb12c4c4b0 (patch)
tree239b59be148611c1d03f0cc97f599af42a59a400 /src/include
parent2b88fdde30d8e9bf833b75a014189e9148233b85 (diff)
snapshot scalability: Move delayChkpt from PGXACT to PGPROC.
The goal of separating hotly accessed per-backend data from PGPROC into PGXACT is to make accesses fast (GetSnapshotData() in particular). But delayChkpt is not actually accessed frequently; only when starting a checkpoint. As it is frequently modified (multiple times in the course of a single transaction), storing it in the same cacheline as hotly accessed data unnecessarily dirties a contended cacheline. Therefore move delayChkpt to PGPROC. This is part of a larger series of patches intending to improve GetSnapshotData() scalability. It is committed and pushed separately, as it is independently beneficial (small but measurable win, limited by the other frequent modifications of PGXACT). Author: Andres Freund Reviewed-By: Robert Haas, Thomas Munro, David Rowley Discussion: https://postgr.es/m/20200301083601.ews6hz5dduc3w2se@alap3.anarazel.de
Diffstat (limited to 'src/include')
-rw-r--r--src/include/storage/proc.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h
index d21780108b..ae4f573ab4 100644
--- a/src/include/storage/proc.h
+++ b/src/include/storage/proc.h
@@ -142,6 +142,8 @@ struct PGPROC
LOCKMASK heldLocks; /* bitmask for lock types already held on this
* lock object by this backend */
+ bool delayChkpt; /* true if this proc delays checkpoint start */
+
/*
* Info to allow us to wait for synchronous replication, if needed.
* waitLSN is InvalidXLogRecPtr if not waiting; set only by user backend.
@@ -232,8 +234,6 @@ typedef struct PGXACT
uint8 vacuumFlags; /* vacuum-related flags, see above */
bool overflowed;
- bool delayChkpt; /* true if this proc delays checkpoint start;
- * previously called InCommit */
uint8 nxids;
} PGXACT;