mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
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.
This commit is contained in:
@ -16,7 +16,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/access/common/heaptuple.c,v 1.114 2007/01/09 22:00:59 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/common/heaptuple.c,v 1.115 2007/02/09 03:35:33 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -582,14 +582,18 @@ heap_getsysattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull)
|
||||
case MinTransactionIdAttributeNumber:
|
||||
result = TransactionIdGetDatum(HeapTupleHeaderGetXmin(tup->t_data));
|
||||
break;
|
||||
case MinCommandIdAttributeNumber:
|
||||
result = CommandIdGetDatum(HeapTupleHeaderGetCmin(tup->t_data));
|
||||
break;
|
||||
case MaxTransactionIdAttributeNumber:
|
||||
result = TransactionIdGetDatum(HeapTupleHeaderGetXmax(tup->t_data));
|
||||
break;
|
||||
case MinCommandIdAttributeNumber:
|
||||
case MaxCommandIdAttributeNumber:
|
||||
result = CommandIdGetDatum(HeapTupleHeaderGetCmax(tup->t_data));
|
||||
/*
|
||||
* cmin and cmax are now both aliases for the same field,
|
||||
* which can in fact also be a combo command id. XXX perhaps we
|
||||
* should return the "real" cmin or cmax if possible, that is
|
||||
* if we are inside the originating transaction?
|
||||
*/
|
||||
result = CommandIdGetDatum(HeapTupleHeaderGetRawCommandId(tup->t_data));
|
||||
break;
|
||||
case TableOidAttributeNumber:
|
||||
result = ObjectIdGetDatum(tup->t_tableOid);
|
||||
|
Reference in New Issue
Block a user