Clean up the representation of special snapshots by including a "method
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 25 Mar 2007 19:45:14 +0000 (19:45 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 25 Mar 2007 19:45:14 +0000 (19:45 +0000)
commite85a01df678c9621c225200f1309ca8e682338ff
tree087e322930b44acbec0764f41c80aa177a25095e
parent75c6519ff68dbb97f73b13e9976fb8075bbde7b8
Clean up the representation of special snapshots by including a "method
pointer" in every Snapshot struct.  This allows removal of the case-by-case
tests in HeapTupleSatisfiesVisibility, which should make it a bit faster
(I didn't try any performance tests though).  More importantly, we are no
longer violating portable C practices by assuming that small integers are
distinct from all pointer values, and HeapTupleSatisfiesDirty no longer
has a non-reentrant API involving side-effects on a global variable.

There were a couple of places calling HeapTupleSatisfiesXXX routines
directly rather than through the HeapTupleSatisfiesVisibility macro.
Since these places had to be changed anyway, I chose to make them go
through the macro for uniformity.

Along the way I renamed HeapTupleSatisfiesSnapshot to HeapTupleSatisfiesMVCC
to emphasize that it's only used with MVCC-type snapshots.  I was sorely
tempted to rename HeapTupleSatisfiesVisibility to HeapTupleSatisfiesSnapshot,
but forebore for the moment to avoid confusion and reduce the likelihood that
this patch breaks some of the pending patches.  Might want to reconsider
doing that later.
contrib/pgstattuple/pgstattuple.c
src/backend/access/heap/heapam.c
src/backend/access/nbtree/nbtinsert.c
src/backend/catalog/catalog.c
src/backend/catalog/index.c
src/backend/executor/execMain.c
src/backend/storage/ipc/procarray.c
src/backend/utils/adt/ri_triggers.c
src/backend/utils/time/tqual.c
src/include/utils/tqual.h