1996-08-28 03:59:28 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
1999-02-14 00:22:53 +01:00
|
|
|
* pg_am.h
|
2005-03-28 01:53:05 +02:00
|
|
|
* definition of the system "access method" relation (pg_am)
|
1997-09-07 07:04:48 +02:00
|
|
|
* along with the relation's initial contents.
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
|
|
|
*
|
2004-12-31 23:04:05 +01:00
|
|
|
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
2000-01-26 06:58:53 +01:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
2005-06-20 12:29:37 +02:00
|
|
|
* $PostgreSQL: pgsql/src/include/catalog/pg_am.h,v 1.35 2005/06/20 10:29:37 teodor Exp $
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
|
|
|
* NOTES
|
1997-09-07 07:04:48 +02:00
|
|
|
* the genbki.sh script reads this file and generates .bki
|
|
|
|
* information from the DATA() statements.
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
1997-09-07 07:04:48 +02:00
|
|
|
* XXX do NOT break up DATA() statements into multiple lines!
|
|
|
|
* the scripts are not as smart as you might think...
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
#ifndef PG_AM_H
|
|
|
|
#define PG_AM_H
|
|
|
|
|
|
|
|
/* ----------------
|
2003-03-10 23:28:22 +01:00
|
|
|
* postgres.h contains the system type definitions and the
|
2005-04-14 03:38:22 +02:00
|
|
|
* CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
|
1997-09-07 07:04:48 +02:00
|
|
|
* can be read by both genbki.sh and the C compiler.
|
1996-08-28 03:59:28 +02:00
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* pg_am definition. cpp turns this into
|
|
|
|
* typedef struct FormData_pg_am
|
1996-08-28 03:59:28 +02:00
|
|
|
* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
*/
|
2005-04-14 03:38:22 +02:00
|
|
|
#define AccessMethodRelationId 2601
|
|
|
|
|
|
|
|
CATALOG(pg_am,2601)
|
1997-09-07 07:04:48 +02:00
|
|
|
{
|
2000-02-17 04:40:02 +01:00
|
|
|
NameData amname; /* access method name */
|
2001-10-25 07:50:21 +02:00
|
|
|
int2 amstrategies; /* total NUMBER of strategies (operators)
|
|
|
|
* by which we can traverse/search this AM */
|
2000-04-12 19:17:23 +02:00
|
|
|
int2 amsupport; /* total NUMBER of support functions that
|
|
|
|
* this AM uses */
|
|
|
|
int2 amorderstrategy;/* if this AM has a sort order, the
|
|
|
|
* strategy number of the sort operator.
|
|
|
|
* Zero if AM is not ordered. */
|
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.
2001-07-16 00:48:19 +02:00
|
|
|
bool amcanunique; /* does AM support UNIQUE indexes? */
|
|
|
|
bool amcanmulticol; /* does AM support multi-column indexes? */
|
2005-06-14 01:14:49 +02:00
|
|
|
bool amoptionalkey; /* can query omit key for the first column? */
|
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.
2001-07-16 00:48:19 +02:00
|
|
|
bool amindexnulls; /* does AM support NULL index entries? */
|
|
|
|
bool amconcurrent; /* does AM support concurrent updates? */
|
2000-02-17 04:40:02 +01:00
|
|
|
regproc aminsert; /* "insert this tuple" function */
|
|
|
|
regproc ambeginscan; /* "start new scan" function */
|
2005-03-28 01:53:05 +02:00
|
|
|
regproc amgettuple; /* "next valid tuple" function */
|
|
|
|
regproc amgetmulti; /* "fetch multiple tuples" function */
|
2000-02-17 04:40:02 +01:00
|
|
|
regproc amrescan; /* "restart this scan" function */
|
|
|
|
regproc amendscan; /* "end this scan" function */
|
|
|
|
regproc ammarkpos; /* "mark current scan position" function */
|
|
|
|
regproc amrestrpos; /* "restore marked scan position" function */
|
|
|
|
regproc ambuild; /* "build new index" function */
|
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.
2001-07-16 00:48:19 +02:00
|
|
|
regproc ambulkdelete; /* bulk-delete function */
|
2003-08-04 02:43:34 +02:00
|
|
|
regproc amvacuumcleanup; /* post-VACUUM cleanup function */
|
2000-04-12 19:17:23 +02:00
|
|
|
regproc amcostestimate; /* estimate cost of an indexscan */
|
1996-08-28 03:59:28 +02:00
|
|
|
} FormData_pg_am;
|
|
|
|
|
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* Form_pg_am corresponds to a pointer to a tuple with
|
|
|
|
* the format of pg_am relation.
|
1996-08-28 03:59:28 +02:00
|
|
|
* ----------------
|
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
typedef FormData_pg_am *Form_pg_am;
|
1996-08-28 03:59:28 +02:00
|
|
|
|
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* compiler constants for pg_am
|
1996-08-28 03:59:28 +02:00
|
|
|
* ----------------
|
|
|
|
*/
|
2005-06-14 01:14:49 +02:00
|
|
|
#define Natts_pg_am 21
|
1997-09-07 07:04:48 +02:00
|
|
|
#define Anum_pg_am_amname 1
|
2005-03-28 01:53:05 +02:00
|
|
|
#define Anum_pg_am_amstrategies 2
|
|
|
|
#define Anum_pg_am_amsupport 3
|
|
|
|
#define Anum_pg_am_amorderstrategy 4
|
|
|
|
#define Anum_pg_am_amcanunique 5
|
|
|
|
#define Anum_pg_am_amcanmulticol 6
|
2005-06-14 01:14:49 +02:00
|
|
|
#define Anum_pg_am_amoptionalkey 7
|
|
|
|
#define Anum_pg_am_amindexnulls 8
|
|
|
|
#define Anum_pg_am_amconcurrent 9
|
|
|
|
#define Anum_pg_am_aminsert 10
|
|
|
|
#define Anum_pg_am_ambeginscan 11
|
|
|
|
#define Anum_pg_am_amgettuple 12
|
|
|
|
#define Anum_pg_am_amgetmulti 13
|
|
|
|
#define Anum_pg_am_amrescan 14
|
|
|
|
#define Anum_pg_am_amendscan 15
|
|
|
|
#define Anum_pg_am_ammarkpos 16
|
|
|
|
#define Anum_pg_am_amrestrpos 17
|
|
|
|
#define Anum_pg_am_ambuild 18
|
|
|
|
#define Anum_pg_am_ambulkdelete 19
|
|
|
|
#define Anum_pg_am_amvacuumcleanup 20
|
|
|
|
#define Anum_pg_am_amcostestimate 21
|
1996-08-28 03:59:28 +02:00
|
|
|
|
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* initial contents of pg_am
|
1996-08-28 03:59:28 +02:00
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
|
2005-06-14 01:14:49 +02:00
|
|
|
DATA(insert OID = 402 ( rtree 8 3 0 f f f f f rtinsert rtbeginscan rtgettuple rtgetmulti rtrescan rtendscan rtmarkpos rtrestrpos rtbuild rtbulkdelete - rtcostestimate ));
|
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.
2001-07-16 00:48:19 +02:00
|
|
|
DESCR("r-tree index access method");
|
2005-06-14 01:14:49 +02:00
|
|
|
DATA(insert OID = 403 ( btree 5 1 1 t t t t t btinsert btbeginscan btgettuple btgetmulti btrescan btendscan btmarkpos btrestrpos btbuild btbulkdelete btvacuumcleanup btcostestimate ));
|
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.
2001-07-16 00:48:19 +02:00
|
|
|
DESCR("b-tree index access method");
|
1996-08-28 03:59:28 +02:00
|
|
|
#define BTREE_AM_OID 403
|
2005-06-14 01:14:49 +02:00
|
|
|
DATA(insert OID = 405 ( hash 1 1 0 f f f f t hashinsert hashbeginscan hashgettuple hashgetmulti hashrescan hashendscan hashmarkpos hashrestrpos hashbuild hashbulkdelete - hashcostestimate ));
|
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.
2001-07-16 00:48:19 +02:00
|
|
|
DESCR("hash index access method");
|
2003-06-23 00:04:55 +02:00
|
|
|
#define HASH_AM_OID 405
|
2005-06-20 12:29:37 +02:00
|
|
|
DATA(insert OID = 783 ( gist 100 7 0 f t f f f gistinsert gistbeginscan gistgettuple gistgetmulti gistrescan gistendscan gistmarkpos gistrestrpos gistbuild gistbulkdelete gistvacuumcleanup gistcostestimate ));
|
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.
2001-07-16 00:48:19 +02:00
|
|
|
DESCR("GiST index access method");
|
2002-07-30 00:14:11 +02:00
|
|
|
#define GIST_AM_OID 783
|
2001-10-28 07:26:15 +01:00
|
|
|
|
2001-11-05 18:46:40 +01:00
|
|
|
#endif /* PG_AM_H */
|