diff options
author | Robert Haas <rhaas@postgresql.org> | 2014-07-01 10:34:42 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2014-07-01 10:34:42 -0400 |
commit | 9f03ca915196dfc871804a1f8aad26207f601fd6 (patch) | |
tree | 15b68e977122a04e46917f085b7d70cedf1d3d73 /src/include/access/nbtree.h | |
parent | 03a25cec8de3737924c9dd33bb868d4bc7a33ad5 (diff) | |
download | postgresql-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/access/nbtree.h')
-rw-r--r-- | src/include/access/nbtree.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/access/nbtree.h b/src/include/access/nbtree.h index ed6f697c8e..9fa943f39e 100644 --- a/src/include/access/nbtree.h +++ b/src/include/access/nbtree.h @@ -717,7 +717,8 @@ typedef struct BTSpool BTSpool; /* opaque type known only within nbtsort.c */ extern BTSpool *_bt_spoolinit(Relation heap, Relation index, bool isunique, bool isdead); extern void _bt_spooldestroy(BTSpool *btspool); -extern void _bt_spool(IndexTuple itup, BTSpool *btspool); +extern void _bt_spool(BTSpool *btspool, ItemPointer self, + Datum *values, bool *isnull); extern void _bt_leafbuild(BTSpool *btspool, BTSpool *spool2); /* |