Restructure index AM interface for index building and index tuple deletion,
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 15 Jul 2001 22:48:19 +0000 (22:48 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 15 Jul 2001 22:48:19 +0000 (22:48 +0000)
commitc8076f09d2eb82a28f27f97230be470fffe7a1e0
tree1e357e7e28313386f9d2e789d3905b37ce2d58f6
parent997439f59e1d487cb2bfa1384f6479fda0c4dd4c
Restructure index AM interface for index building and index tuple deletion,
per previous discussion on pghackers.  Most of the duplicate code in
different AMs' ambuild routines has been moved out to a common routine
in index.c; this means that all index types now do the right things about
inserting recently-dead tuples, etc.  (I also removed support for EXTEND
INDEX in the ambuild routines, since that's about to go away anyway, and
it cluttered the code a lot.)  The retail indextuple deletion routines have
been replaced by a "bulk delete" routine in which the indexscan is inside
the access method.  I haven't pushed this change as far as it should go yet,
but it should allow considerable simplification of the internal bookkeeping
for deletions.  Also, add flag columns to pg_am to eliminate various
hardcoded tests on AM OIDs, and remove unused pg_am columns.

Fix rtree and gist index types to not attempt to store NULLs; before this,
gist usually crashed, while rtree managed not to crash but computed wacko
bounding boxes for NULL entries (which might have had something to do with
the performance problems we've heard about occasionally).

Add AtEOXact routines to hash, rtree, and gist, all of which have static
state that needs to be reset after an error.  We discovered this need long
ago for btree, but missed the other guys.

Oh, one more thing: concurrent VACUUM is now the default.
47 files changed:
doc/src/sgml/catalogs.sgml
src/backend/access/common/indexvalid.c
src/backend/access/gist/gist.c
src/backend/access/gist/gistscan.c
src/backend/access/hash/hash.c
src/backend/access/hash/hashovfl.c
src/backend/access/hash/hashpage.c
src/backend/access/hash/hashscan.c
src/backend/access/index/indexam.c
src/backend/access/nbtree/Makefile
src/backend/access/nbtree/README
src/backend/access/nbtree/nbtinsert.c
src/backend/access/nbtree/nbtpage.c
src/backend/access/nbtree/nbtree.c
src/backend/access/nbtree/nbtscan.c [deleted file]
src/backend/access/nbtree/nbtsearch.c
src/backend/access/rtree/rtree.c
src/backend/access/rtree/rtscan.c
src/backend/access/transam/xact.c
src/backend/bootstrap/bootstrap.c
src/backend/catalog/heap.c
src/backend/catalog/index.c
src/backend/catalog/pg_operator.c
src/backend/commands/command.c
src/backend/commands/indexcmds.c
src/backend/commands/vacuum.c
src/backend/commands/vacuumlazy.c
src/backend/executor/execUtils.c
src/backend/executor/nodeIndexscan.c
src/backend/executor/nodeSeqscan.c
src/backend/optimizer/util/plancat.c
src/backend/utils/adt/datum.c
src/bin/initdb/initdb.sh
src/include/access/genam.h
src/include/access/gist.h
src/include/access/gistscan.h
src/include/access/hash.h
src/include/access/nbtree.h
src/include/access/rtree.h
src/include/catalog/catversion.h
src/include/catalog/index.h
src/include/catalog/pg_am.h
src/include/catalog/pg_index.h
src/include/catalog/pg_proc.h
src/test/regress/expected/oidjoins.out
src/test/regress/expected/opr_sanity.out
src/test/regress/sql/oidjoins.sql