diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-02-09 03:35:35 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-02-09 03:35:35 +0000 |
commit | c398300330cb3060d50652800dbd12729ab9f5ef (patch) | |
tree | 53d16880d6a38ffe3f6ddd125d644e1e984d14d1 /src/pl/plpython/plpython.c | |
parent | acb3416686d44885b6f7d40daacb8e4c1a28e366 (diff) | |
download | postgresql-c398300330cb3060d50652800dbd12729ab9f5ef.tar.gz postgresql-c398300330cb3060d50652800dbd12729ab9f5ef.zip |
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.
Diffstat (limited to 'src/pl/plpython/plpython.c')
-rw-r--r-- | src/pl/plpython/plpython.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c index cd0f701581e..90a3f87b150 100644 --- a/src/pl/plpython/plpython.c +++ b/src/pl/plpython/plpython.c @@ -1,7 +1,7 @@ /********************************************************************** * plpython.c - python as a procedural language for PostgreSQL * - * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.94 2007/02/01 19:10:30 momjian Exp $ + * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.95 2007/02/09 03:35:35 tgl Exp $ * ********************************************************************* */ @@ -123,7 +123,7 @@ typedef struct PLyProcedure char *proname; /* SQL name of procedure */ char *pyname; /* Python name of procedure */ TransactionId fn_xmin; - CommandId fn_cmin; + ItemPointerData fn_tid; bool fn_readonly; PLyTypeInfo result; /* also used to store info for trigger tuple * type */ @@ -1100,7 +1100,7 @@ PLy_procedure_get(FunctionCallInfo fcinfo, Oid tgreloid) elog(FATAL, "proc->me != plproc"); /* did we find an up-to-date cache entry? */ if (proc->fn_xmin != HeapTupleHeaderGetXmin(procTup->t_data) || - proc->fn_cmin != HeapTupleHeaderGetCmin(procTup->t_data)) + !ItemPointerEquals(&proc->fn_tid, &procTup->t_self)) { Py_DECREF(plproc); proc = NULL; @@ -1151,7 +1151,7 @@ PLy_procedure_create(FunctionCallInfo fcinfo, Oid tgreloid, proc->proname = PLy_strdup(NameStr(procStruct->proname)); proc->pyname = PLy_strdup(procName); proc->fn_xmin = HeapTupleHeaderGetXmin(procTup->t_data); - proc->fn_cmin = HeapTupleHeaderGetCmin(procTup->t_data); + proc->fn_tid = procTup->t_self; /* Remember if function is STABLE/IMMUTABLE */ proc->fn_readonly = (procStruct->provolatile != PROVOLATILE_VOLATILE); |