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
|
|
|
*
|
|
|
|
*
|
2010-01-02 17:58:17 +01:00
|
|
|
* Portions Copyright (c) 1996-2010, 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
|
|
|
*
|
2010-09-20 22:08:53 +02:00
|
|
|
* src/include/catalog/pg_am.h
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
|
|
|
* NOTES
|
2010-01-05 02:06:57 +01:00
|
|
|
* the genbki.pl script reads this file and generates .bki
|
1997-09-07 07:04:48 +02:00
|
|
|
* 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
|
|
|
|
|
2008-03-27 04:57:34 +01:00
|
|
|
#include "catalog/genbki.h"
|
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-10-15 04:49:52 +02:00
|
|
|
#define AccessMethodRelationId 2601
|
2005-04-14 03:38:22 +02:00
|
|
|
|
|
|
|
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 */
|
2007-01-09 03:14:16 +01:00
|
|
|
int2 amstrategies; /* total number of strategies (operators) by
|
2007-11-15 22:14:46 +01:00
|
|
|
* which we can traverse/search this AM. Zero
|
|
|
|
* if AM does not have a fixed set of strategy
|
|
|
|
* assignments. */
|
2007-01-09 03:14:16 +01:00
|
|
|
int2 amsupport; /* total number of support functions that this
|
2005-10-15 04:49:52 +02:00
|
|
|
* AM uses */
|
2010-11-24 20:20:39 +01:00
|
|
|
bool amcanorder; /* does AM support order by column value? */
|
|
|
|
bool amcanorderbyop; /* does AM support order by operator result? */
|
2008-10-18 00:10:30 +02:00
|
|
|
bool amcanbackward; /* does AM support backward scan? */
|
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? */
|
2010-01-01 22:53:49 +01:00
|
|
|
bool amsearchnulls; /* can AM search for NULL/NOT NULL entries? */
|
2006-05-03 00:25:10 +02:00
|
|
|
bool amstorage; /* can storage type differ from column type? */
|
2006-05-02 13:28:56 +02:00
|
|
|
bool amclusterable; /* does AM support cluster command? */
|
2008-09-15 20:43:41 +02:00
|
|
|
Oid amkeytype; /* type of data in index, or InvalidOid */
|
2000-02-17 04:40:02 +01:00
|
|
|
regproc aminsert; /* "insert this tuple" function */
|
2010-12-03 02:50:48 +01:00
|
|
|
regproc ambeginscan; /* "prepare for index scan" function */
|
2009-03-06 00:06:45 +01:00
|
|
|
regproc amgettuple; /* "next valid tuple" function, or 0 */
|
|
|
|
regproc amgetbitmap; /* "fetch all valid tuples" function, or 0 */
|
2010-12-03 02:50:48 +01:00
|
|
|
regproc amrescan; /* "(re)start index scan" function */
|
|
|
|
regproc amendscan; /* "end index scan" function */
|
2000-02-17 04:40:02 +01:00
|
|
|
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 */
|
2006-07-04 00:45:41 +02:00
|
|
|
regproc amoptions; /* parse AM-specific parameters */
|
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
|
|
|
* ----------------
|
|
|
|
*/
|
2010-11-24 20:20:39 +01:00
|
|
|
#define Natts_pg_am 27
|
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
|
2007-01-21 00:13:01 +01:00
|
|
|
#define Anum_pg_am_amcanorder 4
|
2010-11-24 20:20:39 +01:00
|
|
|
#define Anum_pg_am_amcanorderbyop 5
|
|
|
|
#define Anum_pg_am_amcanbackward 6
|
|
|
|
#define Anum_pg_am_amcanunique 7
|
|
|
|
#define Anum_pg_am_amcanmulticol 8
|
|
|
|
#define Anum_pg_am_amoptionalkey 9
|
|
|
|
#define Anum_pg_am_amindexnulls 10
|
|
|
|
#define Anum_pg_am_amsearchnulls 11
|
|
|
|
#define Anum_pg_am_amstorage 12
|
|
|
|
#define Anum_pg_am_amclusterable 13
|
|
|
|
#define Anum_pg_am_amkeytype 14
|
|
|
|
#define Anum_pg_am_aminsert 15
|
|
|
|
#define Anum_pg_am_ambeginscan 16
|
|
|
|
#define Anum_pg_am_amgettuple 17
|
|
|
|
#define Anum_pg_am_amgetbitmap 18
|
|
|
|
#define Anum_pg_am_amrescan 19
|
|
|
|
#define Anum_pg_am_amendscan 20
|
|
|
|
#define Anum_pg_am_ammarkpos 21
|
|
|
|
#define Anum_pg_am_amrestrpos 22
|
|
|
|
#define Anum_pg_am_ambuild 23
|
|
|
|
#define Anum_pg_am_ambulkdelete 24
|
|
|
|
#define Anum_pg_am_amvacuumcleanup 25
|
|
|
|
#define Anum_pg_am_amcostestimate 26
|
|
|
|
#define Anum_pg_am_amoptions 27
|
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
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
|
2010-11-24 20:20:39 +01:00
|
|
|
DATA(insert OID = 403 ( btree 5 1 t f t t t t t t f t 0 btinsert btbeginscan btgettuple btgetbitmap btrescan btendscan btmarkpos btrestrpos btbuild btbulkdelete btvacuumcleanup btcostestimate btoptions ));
|
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
|
2010-11-24 20:20:39 +01:00
|
|
|
DATA(insert OID = 405 ( hash 1 1 f f t f f f f f f f 23 hashinsert hashbeginscan hashgettuple hashgetbitmap hashrescan hashendscan hashmarkpos hashrestrpos hashbuild hashbulkdelete hashvacuumcleanup hashcostestimate hashoptions ));
|
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
|
2010-11-24 20:20:39 +01:00
|
|
|
DATA(insert OID = 783 ( gist 0 7 f f f f t t t t t t 0 gistinsert gistbeginscan gistgettuple gistgetbitmap gistrescan gistendscan gistmarkpos gistrestrpos gistbuild gistbulkdelete gistvacuumcleanup gistcostestimate gistoptions ));
|
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
|
2010-11-24 20:20:39 +01:00
|
|
|
DATA(insert OID = 2742 ( gin 0 5 f f f f t t f f t f 0 gininsert ginbeginscan - gingetbitmap ginrescan ginendscan ginmarkpos ginrestrpos ginbuild ginbulkdelete ginvacuumcleanup gincostestimate ginoptions ));
|
2006-05-02 13:28:56 +02:00
|
|
|
DESCR("GIN index access method");
|
|
|
|
#define GIN_AM_OID 2742
|
2001-10-28 07:26:15 +01:00
|
|
|
|
2001-11-05 18:46:40 +01:00
|
|
|
#endif /* PG_AM_H */
|