diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-07-14 22:18:02 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-07-14 22:18:02 +0000 |
commit | 6bfe64032efd043f80a495a495331dcfc2d9f05c (patch) | |
tree | d0cc092d38bdea690a79e4aebfa4629e1db54e96 /src/include/nodes/execnodes.h | |
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/nodes/execnodes.h')
-rw-r--r-- | src/include/nodes/execnodes.h | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index 2c21dba9c23..62a887d754b 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; /* ---------------- |