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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user