diff options
| author | Tom Lane | 2000-07-14 22:18:02 +0000 |
|---|---|---|
| committer | Tom Lane | 2000-07-14 22:18:02 +0000 |
| commit | 6bfe64032efd043f80a495a495331dcfc2d9f05c (patch) | |
| tree | d0cc092d38bdea690a79e4aebfa4629e1db54e96 /src/include/access | |
| parent | a30bc7c75a54910a78d1939bd32f5d91164ba8a4 (diff) | |
Cleanup of code for creating index entries. Functional indexes with
pass-by-ref data types --- eg, an index on lower(textfield) --- no longer
leak memory during index creation or update. Clean up a lot of redundant
code ... did you know that copy, vacuum, truncate, reindex, extend index,
and bootstrap each basically duplicated the main executor's logic for
extracting information about an index and preparing index entries?
Functional indexes should be a little faster now too, due to removal
of repeated function lookups.
CREATE INDEX 'opt_type' clause is deimplemented by these changes,
but I haven't removed it from the parser yet (need to merge with
Thomas' latest change set first).
Diffstat (limited to 'src/include/access')
| -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 |
6 files changed, 11 insertions, 69 deletions
diff --git a/src/include/access/funcindex.h b/src/include/access/funcindex.h deleted file mode 100644 index 0555755aaab..00000000000 --- 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 c7e0c5021b4..b62a979f051 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 dd8f557e9ba..1297b02ff01 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 aa461a75e2b..17d3496dee0 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 99d4901bcdc..9178f8c410e 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 e01cb7a31b6..a5047729616 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 * ---------------- |
