Content-Length: 262051 | pFad | http://github.com/postgrespro/postgres/commit/d17b6df239e6eebf288969e931cdbe8076d1fe12

F1 Fix knn-GiST queue comparison function to return heap tuples first. · postgrespro/postgres@d17b6df · GitHub
Skip to content

Commit d17b6df

Browse files
committed
Fix knn-GiST queue comparison function to return heap tuples first.
The part of the comparison function that was supposed to keep heap tuples ahead of index items was backwards. It would not lead to incorrect results, but it is more efficient to return heap tuples first, before scanning more index pages, when both have the same distance. Alexander Korotkov
1 parent 2e105de commit d17b6df

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/access/gist/gistscan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ pairingheap_GISTSearchItem_cmp(const pairingheap_node *a, const pairingheap_node
4141

4242
/* Heap items go before inner pages, to ensure a depth-first search */
4343
if (GISTSearchItemIsHeap(*sa) && !GISTSearchItemIsHeap(*sb))
44-
return -1;
45-
if (!GISTSearchItemIsHeap(*sa) && GISTSearchItemIsHeap(*sb))
4644
return 1;
45+
if (!GISTSearchItemIsHeap(*sa) && GISTSearchItemIsHeap(*sb))
46+
return -1;
4747

4848
return 0;
4949
}

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/d17b6df239e6eebf288969e931cdbe8076d1fe12

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy