diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-03-21 01:24:04 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-03-21 01:24:04 +0000 |
commit | ee4ddac137b7c66e3bec6f74e3503236476cb16e (patch) | |
tree | 3f8d12f472288b6758fc74802230374ef0e4b764 /src/backend/executor | |
parent | fe7015f5e821d70428995f04726215fc79294f10 (diff) | |
download | postgresql-ee4ddac137b7c66e3bec6f74e3503236476cb16e.tar.gz postgresql-ee4ddac137b7c66e3bec6f74e3503236476cb16e.zip |
Convert index-related tuple handling routines from char 'n'/' ' to bool
convention for isnull flags. Also, remove the useless InsertIndexResult
return struct from index AM aminsert calls --- there is no reason for
the caller to know where in the index the tuple was inserted, and we
were wasting a palloc cycle per insert to deliver this uninteresting
value (plus nontrivial complexity in some AMs).
I forced initdb because of the change in the signature of the aminsert
routines, even though nothing really looks at those pg_proc entries...
Diffstat (limited to 'src/backend/executor')
-rw-r--r-- | src/backend/executor/execUtils.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/src/backend/executor/execUtils.c b/src/backend/executor/execUtils.c index 74567b04417..b1840b45cf9 100644 --- a/src/backend/executor/execUtils.c +++ b/src/backend/executor/execUtils.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/execUtils.c,v 1.118 2005/03/16 21:38:07 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/executor/execUtils.c,v 1.119 2005/03/21 01:24:03 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -861,8 +861,8 @@ ExecInsertIndexTuples(TupleTableSlot *slot, Relation heapRelation; IndexInfo **indexInfoArray; ExprContext *econtext; - Datum datum[INDEX_MAX_KEYS]; - char nullv[INDEX_MAX_KEYS]; + Datum values[INDEX_MAX_KEYS]; + bool isnull[INDEX_MAX_KEYS]; /* * Get information from the result relation info structure. @@ -889,7 +889,6 @@ ExecInsertIndexTuples(TupleTableSlot *slot, for (i = 0; i < numIndices; i++) { IndexInfo *indexInfo; - InsertIndexResult result; if (relationDescs[i] == NULL) continue; @@ -920,35 +919,31 @@ ExecInsertIndexTuples(TupleTableSlot *slot, } /* - * FormIndexDatum fills in its datum and null parameters with - * attribute information taken from the given tuple. It also - * computes any expressions needed. + * FormIndexDatum fills in its values and isnull parameters with + * the appropriate values for the column(s) of the index. */ FormIndexDatum(indexInfo, slot, estate, - datum, - nullv); + values, + isnull); /* * The index AM does the rest. Note we suppress unique-index * checks if we are being called from VACUUM, since VACUUM may * need to move dead tuples that have the same keys as live ones. */ - result = index_insert(relationDescs[i], /* index relation */ - datum, /* array of index Datums */ - nullv, /* info on nulls */ - tupleid, /* tid of heap tuple */ - heapRelation, - relationDescs[i]->rd_index->indisunique && !is_vacuum); + index_insert(relationDescs[i], /* index relation */ + values, /* array of index Datums */ + isnull, /* null flags */ + tupleid, /* tid of heap tuple */ + heapRelation, + relationDescs[i]->rd_index->indisunique && !is_vacuum); /* * keep track of index inserts for debugging */ IncrIndexInserted(); - - if (result) - pfree(result); } } |