Combine cmin and cmax fields of HeapTupleHeaders into a single field, by
Tom Lane <tgl@sss.pgh.pa.us>
Combine cmin and cmax fields of HeapTupleHeaders into a single field, by keeping private state in each backend that has inserted and deleted the same tuple during its current top-level transaction. This is sufficient since there is no need to be able to determine the cmin/cmax from any other transaction. This gets us back down to 23-byte headers, removing a penalty paid in 8.0 to support subtransactions. Patch by Heikki Linnakangas, with minor revisions by moi, following a design hashed out awhile back on the pghackers list.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/common/heaptuple.c | modified | +9 −5 |
| src/backend/access/heap/heapam.c | modified | +22 −14 |
| src/backend/access/transam/xact.c | modified | +6 −2 |
| src/backend/utils/fmgr/fmgr.c | modified | +4 −4 |
| src/backend/utils/time/combocid.c | added | +282 −0 |
| src/backend/utils/time/Makefile | modified | +3 −3 |
| src/include/access/htup.h | modified | +65 −53 |
| src/include/catalog/catversion.h | modified | +2 −2 |
| src/include/storage/bufpage.h | modified | +5 −4 |
| src/include/utils/combocid.h | added | +25 −0 |
| src/pl/plperl/plperl.c | modified | +16 −18 |
| src/pl/plpgsql/src/pl_comp.c | modified | +3 −3 |
| src/pl/plpgsql/src/plpgsql.h | modified | +2 −2 |
| src/pl/plpython/plpython.c | modified | +4 −4 |
| src/pl/tcl/pltcl.c | modified | +4 −4 |
| src/test/regress/expected/combocid.out | added | +242 −0 |
| src/test/regress/expected/without_oid.out | modified | +4 −3 |
| src/test/regress/parallel_schedule | modified | +2 −2 |
| src/test/regress/serial_schedule | modified | +2 −1 |
| src/test/regress/sql/combocid.sql | added | +93 −0 |
| src/test/regress/sql/without_oid.sql | modified | +4 −3 |