diff options
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/access/funcindex.h | 43 | ||||
| -rw-r--r-- | src/include/access/genam.h | 6 | ||||
| -rw-r--r-- | src/include/access/gist.h | 1 | ||||
| -rw-r--r-- | src/include/access/hash.h | 3 | ||||
| -rw-r--r-- | src/include/access/istrat.h | 13 | ||||
| -rw-r--r-- | src/include/access/itup.h | 14 | ||||
| -rw-r--r-- | src/include/bootstrap/bootstrap.h | 14 | ||||
| -rw-r--r-- | src/include/catalog/index.h | 39 | ||||
| -rw-r--r-- | src/include/catalog/pg_proc.h | 10 | ||||
| -rw-r--r-- | src/include/commands/vacuum.h | 15 | ||||
| -rw-r--r-- | src/include/nodes/execnodes.h | 32 | ||||
| -rw-r--r-- | src/include/utils/rel.h | 3 |
12 files changed, 66 insertions, 127 deletions
diff --git a/src/include/access/funcindex.h b/src/include/access/funcindex.h deleted file mode 100644 index 0555755aaa..0000000000 --- a/src/include/access/funcindex.h +++ /dev/null @@ -1,43 +0,0 @@ -/*------------------------------------------------------------------------- - * - * funcindex.h - * - * - * - * Portions Copyright (c) 1996-2000, PostgreSQL, Inc - * Portions Copyright (c) 1994, Regents of the University of California - * - * $Id: funcindex.h,v 1.9 2000/01/26 05:57:50 momjian Exp $ - * - *------------------------------------------------------------------------- - */ -#ifndef _FUNC_INDEX_INCLUDED_ -#define _FUNC_INDEX_INCLUDED_ - -typedef struct -{ - int nargs; - Oid arglist[FUNC_MAX_ARGS]; - Oid procOid; - NameData funcName; -} FuncIndexInfo; - -typedef FuncIndexInfo *FuncIndexInfoPtr; - -/* - * some marginally useful macro definitions - */ -/* #define FIgetname(FINFO) (&((FINFO)->funcName.data[0]))*/ -#define FIgetname(FINFO) (FINFO)->funcName.data -#define FIgetnArgs(FINFO) (FINFO)->nargs -#define FIgetProcOid(FINFO) (FINFO)->procOid -#define FIgetArg(FINFO, argnum) (FINFO)->arglist[argnum] -#define FIgetArglist(FINFO) (FINFO)->arglist - -#define FIsetnArgs(FINFO, numargs) ((FINFO)->nargs = numargs) -#define FIsetProcOid(FINFO, id) ((FINFO)->procOid = id) -#define FIsetArg(FINFO, argnum, argtype) ((FINFO)->arglist[argnum] = argtype) - -#define FIisFunctionalIndex(FINFO) (FINFO->procOid != InvalidOid) - -#endif /* FUNCINDEX_H */ diff --git a/src/include/access/genam.h b/src/include/access/genam.h index c7e0c5021b..b62a979f05 100644 --- a/src/include/access/genam.h +++ b/src/include/access/genam.h @@ -7,14 +7,13 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: genam.h,v 1.23 2000/01/26 05:57:50 momjian Exp $ + * $Id: genam.h,v 1.24 2000/07/14 22:17:53 tgl Exp $ * *------------------------------------------------------------------------- */ #ifndef GENAM_H #define GENAM_H -#include "access/funcindex.h" #include "access/itup.h" #include "access/relscan.h" #include "access/sdir.h" @@ -42,9 +41,6 @@ extern RetrieveIndexResult index_getnext(IndexScanDesc scan, extern RegProcedure index_cost_estimator(Relation relation); extern RegProcedure index_getprocid(Relation irel, AttrNumber attnum, uint16 procnum); -extern Datum GetIndexValue(HeapTuple tuple, TupleDesc hTupDesc, - int attOff, AttrNumber *attrNums, FuncIndexInfo *fInfo, - bool *attNull); /* in genam.c */ extern IndexScanDesc RelationGetIndexScan(Relation relation, bool scanFromEnd, diff --git a/src/include/access/gist.h b/src/include/access/gist.h index dd8f557e9b..1297b02ff0 100644 --- a/src/include/access/gist.h +++ b/src/include/access/gist.h @@ -12,7 +12,6 @@ #ifndef GIST_H #define GIST_H -#include "access/funcindex.h" #include "access/itup.h" #include "access/relscan.h" #include "access/sdir.h" diff --git a/src/include/access/hash.h b/src/include/access/hash.h index aa461a75e2..17d3496dee 100644 --- a/src/include/access/hash.h +++ b/src/include/access/hash.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: hash.h,v 1.34 2000/06/19 03:54:35 tgl Exp $ + * $Id: hash.h,v 1.35 2000/07/14 22:17:53 tgl Exp $ * * NOTES * modeled after Margo Seltzer's hash implementation for unix. @@ -17,7 +17,6 @@ #ifndef HASH_H #define HASH_H -#include "access/funcindex.h" #include "access/itup.h" #include "access/relscan.h" #include "access/sdir.h" diff --git a/src/include/access/istrat.h b/src/include/access/istrat.h index 99d4901bcd..9178f8c410 100644 --- a/src/include/access/istrat.h +++ b/src/include/access/istrat.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: istrat.h,v 1.17 2000/06/08 22:37:36 momjian Exp $ + * $Id: istrat.h,v 1.18 2000/07/14 22:17:53 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -56,9 +56,12 @@ extern StrategyNumber RelationGetStrategy(Relation relation, AttrNumber attributeNumber, StrategyEvaluation evaluation, RegProcedure procedure); extern void IndexSupportInitialize(IndexStrategy indexStrategy, - RegProcedure *indexSupport, Oid indexObjectId, - Oid accessMethodObjectId, StrategyNumber maxStrategyNumber, - StrategyNumber maxSupportNumber, AttrNumber maxAttributeNumber); - + RegProcedure *indexSupport, + bool *isUnique, + Oid indexObjectId, + Oid accessMethodObjectId, + StrategyNumber maxStrategyNumber, + StrategyNumber maxSupportNumber, + AttrNumber maxAttributeNumber); #endif /* ISTRAT_H */ diff --git a/src/include/access/itup.h b/src/include/access/itup.h index e01cb7a31b..a504772961 100644 --- a/src/include/access/itup.h +++ b/src/include/access/itup.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: itup.h,v 1.24 2000/03/17 02:36:37 tgl Exp $ + * $Id: itup.h,v 1.25 2000/07/14 22:17:53 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -61,18 +61,6 @@ typedef struct RetrieveIndexResultData typedef RetrieveIndexResultData *RetrieveIndexResult; -/*----------------- - * PredInfo - - * used for partial indices - *----------------- - */ -typedef struct PredInfo -{ - Node *pred; - Node *oldPred; -} PredInfo; - - /* ---------------- * externs * ---------------- diff --git a/src/include/bootstrap/bootstrap.h b/src/include/bootstrap/bootstrap.h index b3ddea19d5..882ac3c7d1 100644 --- a/src/include/bootstrap/bootstrap.h +++ b/src/include/bootstrap/bootstrap.h @@ -7,18 +7,21 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: bootstrap.h,v 1.18 2000/06/17 23:41:49 tgl Exp $ + * $Id: bootstrap.h,v 1.19 2000/07/14 22:17:54 tgl Exp $ * *------------------------------------------------------------------------- */ #ifndef BOOTSTRAP_H #define BOOTSTRAP_H -#include "access/funcindex.h" #include "access/itup.h" +#include "nodes/execnodes.h" #include "utils/rel.h" -#define MAXATTR 40 /* max. number of attributes in a relation */ +/* MAXATTR is the maximum number of attributes in a relation supported + * at bootstrap time (ie, the max possible in a system table). + */ +#define MAXATTR 40 typedef struct hashnode { @@ -35,10 +38,7 @@ extern int DebugMode; extern int BootstrapMain(int ac, char *av[]); -extern void index_register(char *heap, char *ind, - int natts, AttrNumber *attnos, - FuncIndexInfo *finfo, PredInfo *predInfo, - bool unique); +extern void index_register(char *heap, char *ind, IndexInfo *indexInfo); extern void err_out(void); extern void InsertOneTuple(Oid objectid); diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h index 66b4f601be..e00b25e6f0 100644 --- a/src/include/catalog/index.h +++ b/src/include/catalog/index.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: index.h,v 1.28 2000/07/12 02:37:27 tgl Exp $ + * $Id: index.h,v 1.29 2000/07/14 22:17:56 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -27,25 +27,24 @@ extern void InitIndexStrategy(int numatts, Oid accessMethodObjectId); extern void index_create(char *heapRelationName, - char *indexRelationName, - FuncIndexInfo *funcInfo, - List *attributeList, - Oid accessMethodObjectId, - int numatts, - AttrNumber *attNums, - Oid *classObjectId, - Node *predicate, - bool islossy, - bool unique, - bool primary, - bool allow_system_table_mods); + char *indexRelationName, + IndexInfo *indexInfo, + Oid accessMethodObjectId, + Oid *classObjectId, + bool islossy, + bool primary, + bool allow_system_table_mods); extern void index_drop(Oid indexId); -extern void FormIndexDatum(int numberOfAttributes, - AttrNumber *attributeNumber, HeapTuple heapTuple, - TupleDesc heapDescriptor, Datum *datum, - char *nullv, FuncIndexInfoPtr fInfo); +extern IndexInfo *BuildIndexInfo(HeapTuple indexTuple); + +extern void FormIndexDatum(IndexInfo *indexInfo, + HeapTuple heapTuple, + TupleDesc heapDescriptor, + MemoryContext resultCxt, + Datum *datum, + char *nullv); extern void UpdateStats(Oid relid, long reltuples, bool inplace); extern bool IndexesAreActive(Oid relid, bool comfirmCommitted); @@ -54,11 +53,7 @@ extern bool SetReindexProcessing(bool processing); extern bool IsReindexProcessing(void); extern void index_build(Relation heapRelation, Relation indexRelation, - int numberOfAttributes, AttrNumber *attributeNumber, - FuncIndexInfo *funcInfo, PredInfo *predInfo, - bool unique); - -extern bool IndexIsUnique(Oid indexId); + IndexInfo *indexInfo, Node *oldPred); extern bool reindex_index(Oid indexId, bool force); extern bool activate_indexes_of_a_table(Oid relid, bool activate); diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index bd260a827b..538299773d 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pg_proc.h,v 1.146 2000/07/08 03:04:21 tgl Exp $ + * $Id: pg_proc.h,v 1.147 2000/07/14 22:17:56 tgl Exp $ * * NOTES * The script catalog/genbki.sh reads this file and generates .bki @@ -677,7 +677,7 @@ DATA(insert OID = 321 ( rtdelete PGUID 12 f t f t 2 f 23 "0 0" 100 0 0 100 DESCR("r-tree(internal)"); DATA(insert OID = 322 ( rtgettuple PGUID 12 f t f t 2 f 23 "0 0" 100 0 0 100 rtgettuple - )); DESCR("r-tree(internal)"); -DATA(insert OID = 323 ( rtbuild PGUID 12 f t f t 8 f 23 "0 0 0 0 0 0 0 0" 100 0 0 100 rtbuild - )); +DATA(insert OID = 323 ( rtbuild PGUID 12 f t f t 5 f 23 "0 0 0 0 0" 100 0 0 100 rtbuild - )); DESCR("r-tree(internal)"); DATA(insert OID = 324 ( rtbeginscan PGUID 12 f t f t 4 f 23 "0 0 0 0" 100 0 0 100 rtbeginscan - )); DESCR("r-tree(internal)"); @@ -706,7 +706,7 @@ DATA(insert OID = 336 ( btmarkpos PGUID 12 f t f t 1 f 23 "0" 100 0 0 100 DESCR("btree(internal)"); DATA(insert OID = 337 ( btrestrpos PGUID 12 f t f t 1 f 23 "0" 100 0 0 100 btrestrpos - )); DESCR("btree(internal)"); -DATA(insert OID = 338 ( btbuild PGUID 12 f t f t 8 f 23 "0 0 0 0 0 0 0 0" 100 0 0 100 btbuild - )); +DATA(insert OID = 338 ( btbuild PGUID 12 f t f t 5 f 23 "0 0 0 0 0" 100 0 0 100 btbuild - )); DESCR("btree(internal)"); DATA(insert OID = 339 ( poly_same PGUID 11 f t t t 2 f 16 "604 604" 100 0 1 0 poly_same - )); @@ -810,7 +810,7 @@ DATA(insert OID = 446 ( hashmarkpos PGUID 12 f t f t 1 f 23 "0" 100 0 0 100 DESCR("hash(internal)"); DATA(insert OID = 447 ( hashrestrpos PGUID 12 f t f t 1 f 23 "0" 100 0 0 100 hashrestrpos - )); DESCR("hash(internal)"); -DATA(insert OID = 448 ( hashbuild PGUID 12 f t f t 8 f 23 "0 0 0 0 0 0 0 0" 100 0 0 100 hashbuild - )); +DATA(insert OID = 448 ( hashbuild PGUID 12 f t f t 5 f 23 "0 0 0 0 0" 100 0 0 100 hashbuild - )); DESCR("hash(internal)"); DATA(insert OID = 449 ( hashint2 PGUID 12 f t t t 1 f 23 "21" 100 0 0 100 hashint2 - )); DESCR("hash"); @@ -1033,7 +1033,7 @@ DATA(insert OID = 780 ( gistmarkpos PGUID 12 f t f t 1 f 23 "0" 100 0 0 100 DESCR("gist(internal)"); DATA(insert OID = 781 ( gistrestrpos PGUID 12 f t f t 1 f 23 "0" 100 0 0 100 gistrestrpos - )); DESCR("gist(internal)"); -DATA(insert OID = 782 ( gistbuild PGUID 12 f t f t 8 f 23 "0 0 0 0 0 0 0 0" 100 0 0 100 gistbuild - )); +DATA(insert OID = 782 ( gistbuild PGUID 12 f t f t 5 f 23 "0 0 0 0 0" 100 0 0 100 gistbuild - )); DESCR("gist(internal)"); DATA(insert OID = 784 ( tintervaleq PGUID 12 f t f t 2 f 16 "704 704" 100 0 0 100 tintervaleq - )); diff --git a/src/include/commands/vacuum.h b/src/include/commands/vacuum.h index fed4c6a9a1..b42a8e6a17 100644 --- a/src/include/commands/vacuum.h +++ b/src/include/commands/vacuum.h @@ -7,17 +7,16 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: vacuum.h,v 1.31 2000/05/29 17:40:44 momjian Exp $ + * $Id: vacuum.h,v 1.32 2000/07/14 22:17:57 tgl Exp $ * *------------------------------------------------------------------------- */ #ifndef VACUUM_H #define VACUUM_H -#include "fmgr.h" -#include "access/funcindex.h" -#include "catalog/pg_index.h" #include "catalog/pg_attribute.h" +#include "catalog/pg_index.h" +#include "fmgr.h" #include "nodes/pg_list.h" #include "storage/itemptr.h" @@ -56,14 +55,6 @@ typedef VacPageListData *VacPageList; typedef struct { - FuncIndexInfo finfo; - FuncIndexInfo *finfoP; - Form_pg_index tform; - int natts; -} IndDesc; - -typedef struct -{ Form_pg_attribute attr; Datum best, guess1, diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index 2c21dba9c2..62a887d754 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -7,39 +7,49 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: execnodes.h,v 1.43 2000/07/12 02:37:32 tgl Exp $ + * $Id: execnodes.h,v 1.44 2000/07/14 22:17:58 tgl Exp $ * *------------------------------------------------------------------------- */ #ifndef EXECNODES_H #define EXECNODES_H -#include "access/funcindex.h" #include "access/relscan.h" #include "access/sdir.h" #include "executor/hashjoin.h" #include "executor/tuptable.h" +#include "fmgr.h" #include "nodes/params.h" #include "nodes/primnodes.h" /* ---------------- * IndexInfo information * - * this class holds the information saying what attributes - * are the key attributes for this index. -cim 10/15/89 - * - * NumKeyAttributes number of key attributes for this index - * KeyAttributeNumbers array of attribute numbers used as keys - * Predicate partial-index predicate for this index + * this class holds the information needed to construct new index + * entries for a particular index. Used for both index_build and + * retail creation of index entries. + * + * NumIndexAttrs number of columns in this index + * (1 if a func. index, else same as NumKeyAttrs) + * NumKeyAttrs number of key attributes for this index + * (ie, number of attrs from underlying relation) + * KeyAttrNumbers underlying-rel attribute numbers used as keys + * Predicate partial-index predicate, or NULL if none + * FuncOid OID of function, or InvalidOid if not f. index + * FuncInfo fmgr lookup data for function, if FuncOid valid + * Unique is it a unique index? * ---------------- */ typedef struct IndexInfo { NodeTag type; - int ii_NumKeyAttributes; - AttrNumber *ii_KeyAttributeNumbers; - FuncIndexInfoPtr ii_FuncIndexInfo; + int ii_NumIndexAttrs; + int ii_NumKeyAttrs; + AttrNumber ii_KeyAttrNumbers[INDEX_MAX_KEYS]; Node *ii_Predicate; + Oid ii_FuncOid; + FmgrInfo ii_FuncInfo; + bool ii_Unique; } IndexInfo; /* ---------------- diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h index 121012d7fd..c90ba3c5ee 100644 --- a/src/include/utils/rel.h +++ b/src/include/utils/rel.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: rel.h,v 1.39 2000/06/30 07:04:03 tgl Exp $ + * $Id: rel.h,v 1.40 2000/07/14 22:18:02 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -92,6 +92,7 @@ typedef struct RelationData bool rd_isnailed; /* rel is nailed in cache */ bool rd_unlinked; /* rel already unlinked or not created yet */ bool rd_indexfound; /* true if rd_indexlist is valid */ + bool rd_uniqueindex; /* true if rel is a UNIQUE index */ Form_pg_am rd_am; /* AM tuple */ Form_pg_class rd_rel; /* RELATION tuple */ Oid rd_id; /* relation's object id */ |
