summaryrefslogtreecommitdiff
path: root/src/backend/access/gin/gindatapage.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2014-01-29 21:22:08 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2014-01-29 21:24:38 +0200
commit626a120656a75bf4fe64b1d0d83c23cb38d3771a (patch)
tree5df49f8a6e195dde0fd21e5e7fb29fef5d666bfb /src/backend/access/gin/gindatapage.c
parent8440897b38be38903ecc2041002bba08e08308ad (diff)
Further optimize GIN multi-key searches.
When skipping over some items in a posting tree, re-find the new location by descending the tree from root, rather than walking the right links. This can save a lot of I/O. Heavily modified from Alexander Korotkov's fast scan patch.
Diffstat (limited to 'src/backend/access/gin/gindatapage.c')
-rw-r--r--src/backend/access/gin/gindatapage.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/backend/access/gin/gindatapage.c b/src/backend/access/gin/gindatapage.c
index 9a0b8ab1f21..c6230f3bc5a 100644
--- a/src/backend/access/gin/gindatapage.c
+++ b/src/backend/access/gin/gindatapage.c
@@ -1639,16 +1639,15 @@ ginInsertItemPointers(Relation index, BlockNumber rootBlkno,
* Starts a new scan on a posting tree.
*/
GinBtreeStack *
-ginScanBeginPostingTree(Relation index, BlockNumber rootBlkno)
+ginScanBeginPostingTree(GinBtree btree, Relation index, BlockNumber rootBlkno)
{
- GinBtreeData btree;
GinBtreeStack *stack;
- ginPrepareDataScan(&btree, index, rootBlkno);
+ ginPrepareDataScan(btree, index, rootBlkno);
- btree.fullScan = TRUE;
+ btree->fullScan = TRUE;
- stack = ginFindLeafPage(&btree, TRUE);
+ stack = ginFindLeafPage(btree, TRUE);
return stack;
}