diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-07-15 22:48:19 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-07-15 22:48:19 +0000 |
commit | c8076f09d2eb82a28f27f97230be470fffe7a1e0 (patch) | |
tree | 1e357e7e28313386f9d2e789d3905b37ce2d58f6 /src/include/access/nbtree.h | |
parent | 997439f59e1d487cb2bfa1384f6479fda0c4dd4c (diff) | |
download | postgresql-c8076f09d2eb82a28f27f97230be470fffe7a1e0.tar.gz postgresql-c8076f09d2eb82a28f27f97230be470fffe7a1e0.zip |
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.
Diffstat (limited to 'src/include/access/nbtree.h')
-rw-r--r-- | src/include/access/nbtree.h | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/include/access/nbtree.h b/src/include/access/nbtree.h index 1ba7f963303..789dd027424 100644 --- a/src/include/access/nbtree.h +++ b/src/include/access/nbtree.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: nbtree.h,v 1.55 2001/03/22 04:00:29 momjian Exp $ + * $Id: nbtree.h,v 1.56 2001/07/15 22:48:18 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -319,6 +319,8 @@ typedef struct xl_btree_newroot */ extern bool BuildingBtree; /* in nbtree.c */ +extern void AtEOXact_nbtree(void); + extern Datum btbuild(PG_FUNCTION_ARGS); extern Datum btinsert(PG_FUNCTION_ARGS); extern Datum btgettuple(PG_FUNCTION_ARGS); @@ -328,7 +330,7 @@ extern void btmovescan(IndexScanDesc scan, Datum v); extern Datum btendscan(PG_FUNCTION_ARGS); extern Datum btmarkpos(PG_FUNCTION_ARGS); extern Datum btrestrpos(PG_FUNCTION_ARGS); -extern Datum btdelete(PG_FUNCTION_ARGS); +extern Datum btbulkdelete(PG_FUNCTION_ARGS); extern void btree_redo(XLogRecPtr lsn, XLogRecord *record); extern void btree_undo(XLogRecPtr lsn, XLogRecord *record); @@ -346,20 +348,12 @@ extern InsertIndexResult _bt_doinsert(Relation rel, BTItem btitem, extern void _bt_metapinit(Relation rel); extern Buffer _bt_getroot(Relation rel, int access); extern Buffer _bt_getbuf(Relation rel, BlockNumber blkno, int access); -extern void _bt_relbuf(Relation rel, Buffer buf, int access); +extern void _bt_relbuf(Relation rel, Buffer buf); extern void _bt_wrtbuf(Relation rel, Buffer buf); extern void _bt_wrtnorelbuf(Relation rel, Buffer buf); extern void _bt_pageinit(Page page, Size size); extern void _bt_metaproot(Relation rel, BlockNumber rootbknum, int level); -extern void _bt_pagedel(Relation rel, ItemPointer tid); - -/* - * prototypes for functions in nbtscan.c - */ -extern void _bt_regscan(IndexScanDesc scan); -extern void _bt_dropscan(IndexScanDesc scan); -extern void _bt_adjscans(Relation rel, ItemPointer tid); -extern void AtEOXact_nbtree(void); +extern void _bt_itemdel(Relation rel, Buffer buf, ItemPointer tid); /* * prototypes for functions in nbtsearch.c |