1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-24 09:27:52 +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:
Tom Lane
2007-02-09 03:35:35 +00:00
parent acb3416686
commit c398300330
21 changed files with 799 additions and 127 deletions

View File

@@ -2,7 +2,7 @@
* pltcl.c - PostgreSQL support for Tcl as
* procedural language (PL)
*
* $PostgreSQL: pgsql/src/pl/tcl/pltcl.c,v 1.109 2007/02/01 19:10:30 momjian Exp $
* $PostgreSQL: pgsql/src/pl/tcl/pltcl.c,v 1.110 2007/02/09 03:35:35 tgl Exp $
*
**********************************************************************/
@@ -76,7 +76,7 @@ typedef struct pltcl_proc_desc
{
char *proname;
TransactionId fn_xmin;
CommandId fn_cmin;
ItemPointerData fn_tid;
bool fn_readonly;
bool lanpltrusted;
FmgrInfo result_in_func;
@@ -962,7 +962,7 @@ compile_pltcl_function(Oid fn_oid, Oid tgreloid)
prodesc = (pltcl_proc_desc *) Tcl_GetHashValue(hashent);
uptodate = (prodesc->fn_xmin == HeapTupleHeaderGetXmin(procTup->t_data) &&
prodesc->fn_cmin == HeapTupleHeaderGetCmin(procTup->t_data));
ItemPointerEquals(&prodesc->fn_tid, &procTup->t_self));
if (!uptodate)
{
@@ -1004,7 +1004,7 @@ compile_pltcl_function(Oid fn_oid, Oid tgreloid)
MemSet(prodesc, 0, sizeof(pltcl_proc_desc));
prodesc->proname = strdup(internal_proname);
prodesc->fn_xmin = HeapTupleHeaderGetXmin(procTup->t_data);
prodesc->fn_cmin = HeapTupleHeaderGetCmin(procTup->t_data);
prodesc->fn_tid = procTup->t_self;
/* Remember if function is STABLE/IMMUTABLE */
prodesc->fn_readonly =