1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Replace functional-index facility with expressional indexes. Any column

of an index can now be a computed expression instead of a simple variable.
Restrictions on expressions are the same as for predicates (only immutable
functions, no sub-selects).  This fixes problems recently introduced with
inlining SQL functions, because the inlining transformation is applied to
both expression trees so the planner can still match them up.  Along the
way, improve efficiency of handling index predicates (both predicates and
index expressions are now cached by the relcache) and fix 7.3 oversight
that didn't record dependencies of predicate expressions.
This commit is contained in:
Tom Lane
2003-05-28 16:04:02 +00:00
parent e5f19598e0
commit fc8d970cbc
50 changed files with 1351 additions and 1283 deletions

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: rel.h,v 1.64 2002/11/23 03:59:09 momjian Exp $
* $Id: rel.h,v 1.65 2003/05/28 16:04:02 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -132,6 +132,8 @@ typedef struct RelationData
/* These are non-NULL only for an index relation: */
Form_pg_index rd_index; /* pg_index tuple describing this index */
struct HeapTupleData *rd_indextuple; /* all of pg_index tuple */
/* "struct HeapTupleData *" avoids need to include htup.h here */
Form_pg_am rd_am; /* pg_am tuple for index's AM */
/* index access support info (used only for an index relation) */
@ -142,6 +144,8 @@ typedef struct RelationData
struct FmgrInfo *rd_supportinfo; /* lookup info for support
* procedures */
/* "struct FmgrInfo" avoids need to include fmgr.h here */
List *rd_indexprs; /* index expression trees, if any */
List *rd_indpred; /* index predicate tree, if any */
/* statistics collection area */
PgStat_Info pgstat_info;

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: relcache.h,v 1.34 2002/08/06 02:36:35 tgl Exp $
* $Id: relcache.h,v 1.35 2003/05/28 16:04:02 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -32,6 +32,8 @@ extern void RelationClose(Relation relation);
* Routines to compute/retrieve additional cached information
*/
extern List *RelationGetIndexList(Relation relation);
extern List *RelationGetIndexExpressions(Relation relation);
extern List *RelationGetIndexPredicate(Relation relation);
extern void RelationInitIndexAccessInfo(Relation relation);