Fix knn-GiST queue comparison function to return heap tuples first.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 17 Feb 2015 20:33:38 +0000 (22:33 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 17 Feb 2015 20:33:38 +0000 (22:33 +0200)
commitd17b6df239e6eebf288969e931cdbe8076d1fe12
treef78a4d7a3354f9c5d0bef3fe9e60ee53f2295b81
parent2e105def09f27d49c1761abab06b427cfaa5d304
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
src/backend/access/gist/gistscan.c