Re: KNN-GiST with recheck

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: Emre Hasegeli <emre(at)hasegeli(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: KNN-GiST with recheck
Date: 2015-02-17 13:21:49
Message-ID: CAPpHfduGjVpTLVxwXmeMuFqR-ykH-ERdewF-KHxSQiRdw29-7g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Feb 15, 2015 at 2:08 PM, Alexander Korotkov <aekorotkov(at)gmail(dot)com>
wrote:

> Following changes has been made in attached patch:
>
> * Get sort operators from pathkeys.
> * Recheck argument of distance function has been reverted.
>

Few comments were added and pairing heap comparison function was fixed in
attached version of patch (knn-gist-recheck-6.patch).
Also I expected that reordering in executor would be slower than reordering
in GiST because of maintaining two heaps instead of one. I've revised
version of patch with reordering in GiST to use pairing heap. I compare two
types of reordering on 10^7 random points and polygons. Results are below.
Test shows that overhead of reordering in executor is insignificant (less
than statistical error).

Reorder in GiST Reorder in executor
points
limit=10 0.10615 0.0880125
limit=100 0.23666875 0.2292375
limit=1000 1.51486875 1.5208375
polygons
limit=10 0.11650625 0.1347
limit=100 0.46279375 0.45294375
limit=1000 3.5170125 3.54868125

Revised patch with reordering in GiST is attached
(knn-gist-recheck-in-gist.patch) as well as testing script (test.py).

------
With best regards,
Alexander Korotkov.

Attachment Content-Type Size
knn-gist-recheck-6.patch application/octet-stream 44.1 KB
knn-gist-recheck-in-gist.patch application/octet-stream 40.7 KB
test.py text/x-python-script 1.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tim Kane 2015-02-17 13:22:15 Re: postgres_fdw foreign keys with default sequence
Previous Message Tim Kane 2015-02-17 13:08:19 postgres_fdw foreign keys with default sequence