aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/execUtils.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-05-28 16:04:02 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-05-28 16:04:02 +0000
commitfc8d970cbcdd6f025475822a4cf01dfda0873226 (patch)
treeca697026dbada6a022dec471191aab5a0ba7eb20 /src/backend/executor/execUtils.c
parente5f19598e07e9a0fc0a5c0f18bfac1fe92d21fc5 (diff)
downloadpostgresql-fc8d970cbcdd6f025475822a4cf01dfda0873226.tar.gz
postgresql-fc8d970cbcdd6f025475822a4cf01dfda0873226.zip
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.
Diffstat (limited to 'src/backend/executor/execUtils.c')
-rw-r--r--src/backend/executor/execUtils.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/backend/executor/execUtils.c b/src/backend/executor/execUtils.c
index c06d951f91e..ca4ff192f44 100644
--- a/src/backend/executor/execUtils.c
+++ b/src/backend/executor/execUtils.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.99 2003/05/05 17:57:47 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.100 2003/05/28 16:03:56 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -706,10 +706,8 @@ ExecOpenIndices(ResultRelInfo *resultRelInfo)
if (!indexDesc->rd_am->amconcurrent)
LockRelation(indexDesc, AccessExclusiveLock);
- /*
- * extract index key information from the index's pg_index tuple
- */
- ii = BuildIndexInfo(indexDesc->rd_index);
+ /* extract index key information from the index's pg_index info */
+ ii = BuildIndexInfo(indexDesc);
relationDescs[i] = indexDesc;
indexInfoArray[i] = ii;
@@ -797,7 +795,7 @@ ExecInsertIndexTuples(TupleTableSlot *slot,
/*
* We will use the EState's per-tuple context for evaluating
- * predicates and functional-index functions (creating it if it's not
+ * predicates and index expressions (creating it if it's not
* already there).
*/
econtext = GetPerTupleExprContext(estate);
@@ -844,11 +842,12 @@ ExecInsertIndexTuples(TupleTableSlot *slot,
/*
* FormIndexDatum fills in its datum and null parameters with
* attribute information taken from the given heap tuple.
+ * It also computes any expressions needed.
*/
FormIndexDatum(indexInfo,
heapTuple,
heapDescriptor,
- econtext->ecxt_per_tuple_memory,
+ estate,
datum,
nullv);