Tweak code so that pg_subtrans is never consulted for XIDs older than
Tom Lane <tgl@sss.pgh.pa.us>
Tweak code so that pg_subtrans is never consulted for XIDs older than RecentXmin (== MyProc->xmin). This ensures that it will be safe to truncate pg_subtrans at RecentGlobalXmin, which should largely eliminate any fear of bloat. Along the way, eliminate SubTransXidsHaveCommonAncestor, which isn't really needed and could not give a trustworthy result anyway under the lookback restriction. In an unrelated but nearby change, #ifdef out GetUndoRecPtr, which has been dead code since 2001 and seems unlikely to ever be resurrected.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/transam/subtrans.c | modified | +17 −25 |
| src/backend/access/transam/transam.c | modified | +13 −15 |
| src/backend/storage/ipc/sinval.c | modified | +4 −2 |
| src/backend/storage/lmgr/lmgr.c | modified | +2 −2 |
| src/backend/utils/time/tqual.c | modified | +2 −4 |
| src/include/access/subtrans.h | modified | +1 −2 |
| src/include/access/xlog.h | modified | +1 −6 |