summaryrefslogtreecommitdiff
path: root/src/include/utils
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2014-07-01 10:34:42 -0400
committerRobert Haas <rhaas@postgresql.org>2014-07-01 10:34:42 -0400
commit9f03ca915196dfc871804a1f8aad26207f601fd6 (patch)
tree15b68e977122a04e46917f085b7d70cedf1d3d73 /src/include/utils
parent03a25cec8de3737924c9dd33bb868d4bc7a33ad5 (diff)
downloadpostgresql-9f03ca915196dfc871804a1f8aad26207f601fd6.tar.gz
Avoid copying index tuples when building an index.
The previous code, perhaps out of concern for avoid memory leaks, formed the tuple in one memory context and then copied it to another memory context. However, this doesn't appear to be necessary, since index_form_tuple and the functions it calls take precautions against leaking memory. In my testing, building the tuple directly inside the sort context shaves several percent off the index build time. Rearrange things so we do that. Patch by me. Review by Amit Kapila, Tom Lane, Andres Freund.
Diffstat (limited to 'src/include/utils')
-rw-r--r--src/include/utils/tuplesort.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/include/utils/tuplesort.h b/src/include/utils/tuplesort.h
index 7d828e064b..253788322f 100644
--- a/src/include/utils/tuplesort.h
+++ b/src/include/utils/tuplesort.h
@@ -84,7 +84,9 @@ extern void tuplesort_set_bound(Tuplesortstate *state, int64 bound);
extern void tuplesort_puttupleslot(Tuplesortstate *state,
TupleTableSlot *slot);
extern void tuplesort_putheaptuple(Tuplesortstate *state, HeapTuple tup);
-extern void tuplesort_putindextuple(Tuplesortstate *state, IndexTuple tuple);
+extern void tuplesort_putindextuplevalues(Tuplesortstate *state,
+ Relation rel, ItemPointer self,
+ Datum *values, bool *isnull);
extern void tuplesort_putdatum(Tuplesortstate *state, Datum val,
bool isNull);