mirror of
https://github.com/postgres/postgres.git
synced 2025-12-02 23:42:46 +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:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/fmgr/fmgr.c,v 1.103 2007/01/05 22:19:43 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/fmgr/fmgr.c,v 1.104 2007/02/09 03:35:34 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -64,7 +64,7 @@ typedef struct
|
||||
/* fn_oid is the hash key and so must be first! */
|
||||
Oid fn_oid; /* OID of an external C function */
|
||||
TransactionId fn_xmin; /* for checking up-to-dateness */
|
||||
CommandId fn_cmin;
|
||||
ItemPointerData fn_tid;
|
||||
PGFunction user_fn; /* the function's address */
|
||||
const Pg_finfo_record *inforec; /* address of its info record */
|
||||
} CFuncHashTabEntry;
|
||||
@@ -483,7 +483,7 @@ lookup_C_func(HeapTuple procedureTuple)
|
||||
if (entry == NULL)
|
||||
return NULL; /* no such entry */
|
||||
if (entry->fn_xmin == HeapTupleHeaderGetXmin(procedureTuple->t_data) &&
|
||||
entry->fn_cmin == HeapTupleHeaderGetCmin(procedureTuple->t_data))
|
||||
ItemPointerEquals(&entry->fn_tid, &procedureTuple->t_self))
|
||||
return entry; /* OK */
|
||||
return NULL; /* entry is out of date */
|
||||
}
|
||||
@@ -521,7 +521,7 @@ record_C_func(HeapTuple procedureTuple,
|
||||
&found);
|
||||
/* OID is already filled in */
|
||||
entry->fn_xmin = HeapTupleHeaderGetXmin(procedureTuple->t_data);
|
||||
entry->fn_cmin = HeapTupleHeaderGetCmin(procedureTuple->t_data);
|
||||
entry->fn_tid = procedureTuple->t_self;
|
||||
entry->user_fn = user_fn;
|
||||
entry->inforec = inforec;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user