OSDN Git Service

Mark index entries "killed" when they are no longer visible to any
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 24 May 2002 18:57:57 +0000 (18:57 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 24 May 2002 18:57:57 +0000 (18:57 +0000)
commit3f4d48802271126b1343289a9d2267ff1ed3788a
treeb8c7507719ba240834e28cfbb56e2badff118b7e
parent2f2d05763d1c55c7998c0d7030659e3db6f60183
Mark index entries "killed" when they are no longer visible to any
transaction, so as to avoid returning them out of the index AM.  Saves
repeated heap_fetch operations on frequently-updated rows.  Also detect
queries on unique keys (equality to all columns of a unique index), and
don't bother continuing scan once we have found first match.

Killing is implemented in the btree and hash AMs, but not yet in rtree
or gist, because there isn't an equally convenient place to do it in
those AMs (the outer amgetnext routine can't do it without re-pinning
the index page).

Did some small cleanup on APIs of HeapTupleSatisfies, heap_fetch, and
index_insert to make this a little easier.
30 files changed:
src/backend/access/gist/gist.c
src/backend/access/hash/hash.c
src/backend/access/hash/hashscan.c
src/backend/access/hash/hashsearch.c
src/backend/access/heap/heapam.c
src/backend/access/heap/tuptoaster.c
src/backend/access/index/genam.c
src/backend/access/index/indexam.c
src/backend/access/nbtree/nbtinsert.c
src/backend/access/nbtree/nbtree.c
src/backend/access/nbtree/nbtsearch.c
src/backend/access/nbtree/nbtutils.c
src/backend/access/rtree/rtree.c
src/backend/catalog/indexing.c
src/backend/commands/analyze.c
src/backend/commands/trigger.c
src/backend/commands/vacuum.c
src/backend/executor/execMain.c
src/backend/executor/execUtils.c
src/backend/executor/nodeTidscan.c
src/backend/storage/ipc/sinval.c
src/backend/utils/time/tqual.c
src/include/access/genam.h
src/include/access/heapam.h
src/include/access/nbtree.h
src/include/access/relscan.h
src/include/access/valid.h
src/include/catalog/pg_proc.h
src/include/executor/executor.h
src/include/utils/tqual.h