diff options
author | Robert Haas <rhaas@postgresql.org> | 2011-11-25 08:02:10 -0500 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2011-11-25 08:02:10 -0500 |
commit | ed0b409d22346b1b027a4c2099ca66984d94b6dd (patch) | |
tree | 3d9942b4131ffa73cbf83735c3965b4c1fc7e307 /src/backend/utils/time/snapmgr.c | |
parent | 9ed439a9c07b69c2617cc98596611fdbdc22472c (diff) | |
download | postgresql-ed0b409d22346b1b027a4c2099ca66984d94b6dd.tar.gz postgresql-ed0b409d22346b1b027a4c2099ca66984d94b6dd.zip |
Move "hot" members of PGPROC into a separate PGXACT array.
This speeds up snapshot-taking and reduces ProcArrayLock contention.
Also, the PGPROC (and PGXACT) structures used by two-phase commit are
now allocated as part of the main array, rather than in a separate
array, and we keep ProcArray sorted in pointer order. These changes
are intended to minimize the number of cache lines that must be pulled
in to take a snapshot, and testing shows a substantial increase in
performance on both read and write workloads at high concurrencies.
Pavan Deolasee, Heikki Linnakangas, Robert Haas
Diffstat (limited to 'src/backend/utils/time/snapmgr.c')
-rw-r--r-- | src/backend/utils/time/snapmgr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c index 50fb78057d8..814cd237399 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -577,7 +577,7 @@ static void SnapshotResetXmin(void) { if (RegisteredSnapshots == 0 && ActiveSnapshot == NULL) - MyProc->xmin = InvalidTransactionId; + MyPgXact->xmin = InvalidTransactionId; } /* |