Re: Yet another fast GiST build

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>, "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>
Cc: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>, Darafei Komяpa Praliaskouski <me(at)komzpa(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Yet another fast GiST build
Date: 2020-09-08 19:05:37
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 08/09/2020 21:33, Pavel Borisov wrote:
> > Thanks! Did you measure the quality of the built index somehow? The
> > ordering shouldn't make any difference to the build speed, but it
> > affects the shape of the resulting index and the speed of queries
> > against it.
> Again I've tried random select tests near axes and haven't noticed any
> performance difference between ordinary gist build and z-ordered one.
> The same is for selects far from axes. Theoretically, there may be a
> possible slowdown for particular points inside the MBR which crosses the
> axis but I haven't tried to dig so deep and haven't tested performance
> as a function of coordinate.
> So I feel this patch is not about select speed optimization.

Ok, thank for confirming.

I've been reviewing the patch today. The biggest changes I've made have
been in restructuring the code in gistbuild.c for readability, but there
are a bunch of smaller changes throughout. Attached is what I've got so
far, squashed into one patch. I'm continuing to review it, but a couple
of questions so far:

In the gistBuildCallback(), you're skipping the tuple if 'tupleIsAlive
== false'. That seems fishy, surely we need to index recently-dead
tuples, too. The normal index build path isn't skipping them either.

How does the 'sortsupport' routine interact with
'compress'/'decompress'? Which representation is passed to the
comparator routine: the original value from the table, the compressed
representation, or the decompressed representation? Do the
comparetup_index_btree() and readtup_index() routines agree with that?

- Heikki

Attachment Content-Type Size
v16-0001-Add-sort-support-for-point-gist_point_sortsuppor.patch text/x-patch 40.9 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2020-09-08 19:10:53 Re: Missing "Up" navigation link between parts and doc root?
Previous Message Andres Freund 2020-09-08 19:01:29 Re: More aggressive vacuuming of temporary tables