Re: [HACKERS] [PATCH] kNN for SP-GiST

From: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
To: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
Cc: Nikita Glukhov <n(dot)gluhov(at)postgrespro(dot)ru>, David Steele <david(at)pgmasters(dot)net>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] [PATCH] kNN for SP-GiST
Date: 2018-08-30 09:41:58
Message-ID: CAPpHfdsDCPJ0v+MEhSsZmtt38KW3eYqXG0oodRv0OmieXQiiRw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Aug 30, 2018 at 12:30 PM Alexander Korotkov
<a(dot)korotkov(at)postgrespro(dot)ru> wrote:
> On Thu, Aug 30, 2018 at 12:17 PM Alexander Korotkov
> <a(dot)korotkov(at)postgrespro(dot)ru> wrote:
> > # Current patch (use list)
> > x run 1 run 2 run 3
> > 0.1 1206 1230 1231
> > 0.01 2862 2813 2802
> > 0.003 13915 13911 13900
>
> Sorry, I didn't explain what these tables means. There are times in
> milliseconds for 3 runs of spgist_bench($x, $x)

Right, performance regression appears to be caused by queue memory
context allocation. I've tried to apply the same approach that we've
in GiST: allocate separate memory context for queue only at second
rescan call. And it appears to work, there is no measurable
regression in comparison to master.

Patch v8
x run 1 run 2 run 3
0.1 680 660 662
0.01 1403 1395 1508
0.003 6561 6475 6223

Revised version of patch is attached. I've squashed patchset into one
patch. Later I'll split it into fewer parts before committing. I'm
going to also make some benchmarking of KNN itself: GiST vs SP-GiST.

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Attachment Content-Type Size
knn-spgist-v8.patch application/octet-stream 97.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2018-08-30 09:52:58 Re: pg_verify_checksums -d option (was: Re: pg_verify_checksums -r option)
Previous Message Alexander Korotkov 2018-08-30 09:30:40 Re: [HACKERS] [PATCH] kNN for SP-GiST