1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-07 19:06:32 +03:00

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.
This commit is contained in:
Heikki Linnakangas
2014-01-29 21:22:08 +02:00
parent 8440897b38
commit 626a120656
3 changed files with 98 additions and 29 deletions

View File

@@ -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;
}