]> granicus.if.org Git - postgresql/blobdiff - src/include/catalog/pg_am.h
Create a "sort support" interface API for faster sorting.
[postgresql] / src / include / catalog / pg_am.h
index dfebc0e8c8f46b6f3c3c949d4add0fb0bd77deee..ddacdf274c49ac7e83b941aa983dbf96214f5812 100644 (file)
@@ -1,17 +1,17 @@
 /*-------------------------------------------------------------------------
  *
  * pg_am.h
- *       definition of the system "am" relation (pg_am)
+ *       definition of the system "access method" relation (pg_am)
  *       along with the relation's initial contents.
  *
  *
- * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
+ * Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $Id: pg_am.h,v 1.14 2000/02/17 03:39:47 tgl Exp $
+ * src/include/catalog/pg_am.h
  *
  * NOTES
- *             the genbki.sh script reads this file and generates .bki
+ *             the genbki.pl script reads this file and generates .bki
  *             information from the DATA() statements.
  *
  *             XXX do NOT break up DATA() statements into multiple lines!
 #ifndef PG_AM_H
 #define PG_AM_H
 
-/* ----------------
- *             postgres.h contains the system type definintions and the
- *             CATALOG(), BOOTSTRAP and DATA() sugar words so this file
- *             can be read by both genbki.sh and the C compiler.
- * ----------------
- */
+#include "catalog/genbki.h"
 
 /* ----------------
  *             pg_am definition.  cpp turns this into
  *             typedef struct FormData_pg_am
  * ----------------
  */
-CATALOG(pg_am)
+#define AccessMethodRelationId 2601
+
+CATALOG(pg_am,2601)
 {
        NameData        amname;                 /* access method name */
-       int4            amowner;                /* usesysid of creator */
-       int2            amstrategies;   /* total NUMBER of strategies by which
-                                                                * we can traverse/search this AM */
-       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. */
-       regproc         amgettuple;             /* "next valid tuple" function */
+       int2            amstrategies;   /* total number of strategies (operators) by
+                                                                * which we can traverse/search this AM. Zero
+                                                                * if AM does not have a fixed set of strategy
+                                                                * assignments. */
+       int2            amsupport;              /* total number of support functions that this
+                                                                * AM uses */
+       bool            amcanorder;             /* does AM support order by column value? */
+       bool            amcanorderbyop; /* does AM support order by operator result? */
+       bool            amcanbackward;  /* does AM support backward scan? */
+       bool            amcanunique;    /* does AM support UNIQUE indexes? */
+       bool            amcanmulticol;  /* does AM support multi-column indexes? */
+       bool            amcanreturn;    /* can AM return IndexTuples? */
+       bool            amoptionalkey;  /* can query omit key for the first column? */
+       bool            amsearcharray;  /* can AM handle ScalarArrayOpExpr quals? */
+       bool            amsearchnulls;  /* can AM search for NULL/NOT NULL entries? */
+       bool            amstorage;              /* can storage type differ from column type? */
+       bool            amclusterable;  /* does AM support cluster command? */
+       bool            ampredlocks;    /* does AM handle predicate locks? */
+       Oid                     amkeytype;              /* type of data in index, or InvalidOid */
        regproc         aminsert;               /* "insert this tuple" function */
-       regproc         amdelete;               /* "delete this tuple" function */
-       regproc         amgetattr;              /* - deprecated */
-       regproc         amsetlock;              /* - deprecated */
-       regproc         amsettid;               /* - deprecated */
-       regproc         amfreetuple;    /* - deprecated */
-       regproc         ambeginscan;    /* "start new scan" function */
-       regproc         amrescan;               /* "restart this scan" function */
-       regproc         amendscan;              /* "end this scan" function */
+       regproc         ambeginscan;    /* "prepare for index scan" function */
+       regproc         amgettuple;             /* "next valid tuple" function, or 0 */
+       regproc         amgetbitmap;    /* "fetch all valid tuples" function, or 0 */
+       regproc         amrescan;               /* "(re)start index scan" function */
+       regproc         amendscan;              /* "end index scan" function */
        regproc         ammarkpos;              /* "mark current scan position" function */
        regproc         amrestrpos;             /* "restore marked scan position" function */
-       regproc         amopen;                 /* - deprecated */
-       regproc         amclose;                /* - deprecated */
        regproc         ambuild;                /* "build new index" function */
-       regproc         amcreate;               /* - deprecated */
-       regproc         amdestroy;              /* - deprecated */
-       regproc         amcostestimate; /* estimate cost of an indexscan */
+       regproc         ambuildempty;   /* "build empty index" function */
+       regproc         ambulkdelete;   /* bulk-delete function */
+       regproc         amvacuumcleanup;        /* post-VACUUM cleanup function */
+       regproc         amcostestimate; /* estimate cost of an indexscan */
+       regproc         amoptions;              /* parse AM-specific parameters */
 } FormData_pg_am;
 
 /* ----------------
@@ -76,45 +80,54 @@ typedef FormData_pg_am *Form_pg_am;
  *             compiler constants for pg_am
  * ----------------
  */
-#define Natts_pg_am                                            23
+#define Natts_pg_am                                            30
 #define Anum_pg_am_amname                              1
-#define Anum_pg_am_amowner                             2
-#define Anum_pg_am_amstrategies                        3
-#define Anum_pg_am_amsupport                   4
-#define Anum_pg_am_amorderstrategy             5
-#define Anum_pg_am_amgettuple                  6
-#define Anum_pg_am_aminsert                            7
-#define Anum_pg_am_amdelete                            8
-#define Anum_pg_am_amgetattr                   9
-#define Anum_pg_am_amsetlock                   10
-#define Anum_pg_am_amsettid                            11
-#define Anum_pg_am_amfreetuple                 12
-#define Anum_pg_am_ambeginscan                 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_amopen                              18
-#define Anum_pg_am_amclose                             19
-#define Anum_pg_am_ambuild                             20
-#define Anum_pg_am_amcreate                            21
-#define Anum_pg_am_amdestroy                   22
-#define Anum_pg_am_amcostestimate              23
+#define Anum_pg_am_amstrategies                        2
+#define Anum_pg_am_amsupport                   3
+#define Anum_pg_am_amcanorder                  4
+#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_amcanreturn                 9
+#define Anum_pg_am_amoptionalkey               10
+#define Anum_pg_am_amsearcharray               11
+#define Anum_pg_am_amsearchnulls               12
+#define Anum_pg_am_amstorage                   13
+#define Anum_pg_am_amclusterable               14
+#define Anum_pg_am_ampredlocks                 15
+#define Anum_pg_am_amkeytype                   16
+#define Anum_pg_am_aminsert                            17
+#define Anum_pg_am_ambeginscan                 18
+#define Anum_pg_am_amgettuple                  19
+#define Anum_pg_am_amgetbitmap                 20
+#define Anum_pg_am_amrescan                            21
+#define Anum_pg_am_amendscan                   22
+#define Anum_pg_am_ammarkpos                   23
+#define Anum_pg_am_amrestrpos                  24
+#define Anum_pg_am_ambuild                             25
+#define Anum_pg_am_ambuildempty                        26
+#define Anum_pg_am_ambulkdelete                        27
+#define Anum_pg_am_amvacuumcleanup             28
+#define Anum_pg_am_amcostestimate              29
+#define Anum_pg_am_amoptions                   30
 
 /* ----------------
  *             initial contents of pg_am
  * ----------------
  */
 
-DATA(insert OID = 402 (  rtree PGUID 8 3 0 rtgettuple rtinsert rtdelete - - - - rtbeginscan rtrescan rtendscan rtmarkpos rtrestrpos - - rtbuild - - rtcostestimate ));
-DESCR("");
-DATA(insert OID = 403 (  btree PGUID 5 1 1 btgettuple btinsert btdelete - - - - btbeginscan btrescan btendscan btmarkpos btrestrpos - - btbuild - - btcostestimate ));
-DESCR("");
+DATA(insert OID = 403 (  btree 5 2 t f t t t t t t t f t t 0 btinsert btbeginscan btgettuple btgetbitmap btrescan btendscan btmarkpos btrestrpos btbuild btbuildempty btbulkdelete btvacuumcleanup btcostestimate btoptions ));
+DESCR("b-tree index access method");
 #define BTREE_AM_OID 403
-DATA(insert OID = 405 (  hash PGUID 1 1 0 hashgettuple hashinsert hashdelete - - - - hashbeginscan hashrescan hashendscan hashmarkpos hashrestrpos - - hashbuild - - hashcostestimate ));
-DESCR("");
+DATA(insert OID = 405 (  hash  1 1 f f t f f f f f f f f f 23 hashinsert hashbeginscan hashgettuple hashgetbitmap hashrescan hashendscan hashmarkpos hashrestrpos hashbuild hashbuildempty hashbulkdelete hashvacuumcleanup hashcostestimate hashoptions ));
+DESCR("hash index access method");
 #define HASH_AM_OID 405
-DATA(insert OID = 783 (  gist PGUID 100 7 0 gistgettuple gistinsert gistdelete - - - - gistbeginscan gistrescan gistendscan gistmarkpos gistrestrpos - - gistbuild - - gistcostestimate ));
-DESCR("");
+DATA(insert OID = 783 (  gist  0 8 f t f f t f t f t t t f 0 gistinsert gistbeginscan gistgettuple gistgetbitmap gistrescan gistendscan gistmarkpos gistrestrpos gistbuild gistbuildempty gistbulkdelete gistvacuumcleanup gistcostestimate gistoptions ));
+DESCR("GiST index access method");
+#define GIST_AM_OID 783
+DATA(insert OID = 2742 (  gin  0 5 f f f f t f t f f t f f 0 gininsert ginbeginscan - gingetbitmap ginrescan ginendscan ginmarkpos ginrestrpos ginbuild ginbuildempty ginbulkdelete ginvacuumcleanup gincostestimate ginoptions ));
+DESCR("GIN index access method");
+#define GIN_AM_OID 2742
 
-#endif  /* PG_AM_H */
+#endif   /* PG_AM_H */