aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gist.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-07-12 02:37:39 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-07-12 02:37:39 +0000
commitbadce86a2c327b40c6146242526d1523455d64a6 (patch)
tree6e0cb658889a2688e76d9ac19a56555c5eb0e738 /src/backend/access/gist/gist.c
parent46fb9c29e2990ba470bb741ff6dd60f2ae218e64 (diff)
downloadpostgresql-badce86a2c327b40c6146242526d1523455d64a6.tar.gz
postgresql-badce86a2c327b40c6146242526d1523455d64a6.zip
First stage of reclaiming memory in executor by resetting short-term
memory contexts. Currently, only leaks in expressions executed as quals or projections are handled. Clean up some old dead cruft in executor while at it --- unused fields in state nodes, that sort of thing.
Diffstat (limited to 'src/backend/access/gist/gist.c')
-rw-r--r--src/backend/access/gist/gist.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c
index 794685da2e1..28c547ffe69 100644
--- a/src/backend/access/gist/gist.c
+++ b/src/backend/access/gist/gist.c
@@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.60 2000/07/03 23:09:11 wieck Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.61 2000/07/12 02:36:46 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -141,11 +141,10 @@ gistbuild(PG_FUNCTION_ARGS)
{
tupleTable = ExecCreateTupleTable(1);
slot = ExecAllocTableSlot(tupleTable);
- econtext = makeNode(ExprContext);
- FillDummyExprContext(econtext, slot, hd, InvalidBuffer);
+ ExecSetSlotDescriptor(slot, hd);
+ econtext = MakeExprContext(slot, TransactionCommandContext);
}
else
-/* shut the compiler up */
{
tupleTable = NULL;
slot = NULL;
@@ -161,13 +160,13 @@ gistbuild(PG_FUNCTION_ARGS)
{
nh++;
+#ifndef OMIT_PARTIAL_INDEX
/*
* If oldPred != NULL, this is an EXTEND INDEX command, so skip
* this tuple if it was already in the existing partial index
*/
if (oldPred != NULL)
{
-#ifndef OMIT_PARTIAL_INDEX
/* SetSlotContents(slot, htup); */
slot->val = htup;
if (ExecQual((List *) oldPred, econtext, false))
@@ -175,7 +174,6 @@ gistbuild(PG_FUNCTION_ARGS)
ni++;
continue;
}
-#endif /* OMIT_PARTIAL_INDEX */
}
/*
@@ -184,13 +182,12 @@ gistbuild(PG_FUNCTION_ARGS)
*/
if (pred != NULL)
{
-#ifndef OMIT_PARTIAL_INDEX
/* SetSlotContents(slot, htup); */
slot->val = htup;
if (!ExecQual((List *) pred, econtext, false))
continue;
-#endif /* OMIT_PARTIAL_INDEX */
}
+#endif /* OMIT_PARTIAL_INDEX */
ni++;
@@ -262,13 +259,13 @@ gistbuild(PG_FUNCTION_ARGS)
/* okay, all heap tuples are indexed */
heap_endscan(scan);
+#ifndef OMIT_PARTIAL_INDEX
if (pred != NULL || oldPred != NULL)
{
-#ifndef OMIT_PARTIAL_INDEX
ExecDropTupleTable(tupleTable, true);
- pfree(econtext);
-#endif /* OMIT_PARTIAL_INDEX */
+ FreeExprContext(econtext);
}
+#endif /* OMIT_PARTIAL_INDEX */
/*
* Since we just counted the tuples in the heap, we update its stats