diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-09-03 15:59:39 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-09-03 15:59:39 +0000 |
| commit | 8fad2e3ff4d86e279366c9d0a398f1f2371493f3 (patch) | |
| tree | ce3dcb3333b752d927dac4207c573626bef5c9b8 /src/include/utils/tqual.h | |
| parent | f79f57a0af619c071054c23763519b93e1f2f4fe (diff) | |
| download | postgresql-8fad2e3ff4d86e279366c9d0a398f1f2371493f3.tar.gz | |
Arrange for GetSnapshotData to copy live-subtransaction XIDs from the
PGPROC array into snapshots, and use this information to avoid visits
to pg_subtrans in HeapTupleSatisfiesSnapshot. This appears to solve
the pg_subtrans-related context swap storm problem that's been reported
by several people for 8.1. While at it, modify GetSnapshotData to not
take an exclusive lock on ProcArrayLock, as closer analysis shows that
shared lock is always sufficient.
Itagaki Takahiro and Tom Lane
Diffstat (limited to 'src/include/utils/tqual.h')
| -rw-r--r-- | src/include/utils/tqual.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/include/utils/tqual.h b/src/include/utils/tqual.h index 6c1fdfd3af..394895d601 100644 --- a/src/include/utils/tqual.h +++ b/src/include/utils/tqual.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/utils/tqual.h,v 1.62 2006/07/13 16:49:20 momjian Exp $ + * $PostgreSQL: pgsql/src/include/utils/tqual.h,v 1.63 2006/09/03 15:59:39 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -40,6 +40,12 @@ typedef struct SnapshotData uint32 xcnt; /* # of xact ids in xip[] */ TransactionId *xip; /* array of xact IDs in progress */ /* note: all ids in xip[] satisfy xmin <= xip[i] < xmax */ + int32 subxcnt; /* # of xact ids in subxip[], -1 if overflow */ + TransactionId *subxip; /* array of subxact IDs in progress */ + /* + * note: all ids in subxip[] are >= xmin, but we don't bother filtering + * out any that are >= xmax + */ CommandId curcid; /* in my xact, CID < curcid are visible */ } SnapshotData; |
