Re: Yet another fast GiST build
Heikki Linnakangas <hlinnaka@iki.fi>
From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Darafei "Komяpa" Praliaskouski <me@komzpa.net>
Cc: "Andrey M. Borodin" <x4mmm@yandex-team.ru>,
Pavel Borisov <pashkin.elfe@gmail.com>, Thomas Munro
<thomas.munro@gmail.com>, Michael Paquier <michael@paquier.xyz>,
Alexander Korotkov <a.korotkov@postgrespro.ru>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2020-09-09T15:39:21Z
Lists: pgsql-hackers
On 09/09/2020 15:20, Darafei "Komяpa" Praliaskouski wrote: > On Wed, Sep 9, 2020 at 3:09 PM Heikki Linnakangas <hlinnaka@iki.fi> wrote: > >> Come to think of it, the point z-order comparator could benefit a lot >> from key abbreviation, too. You could do the point -> zorder conversion >> in the abbreviation routine. > > That's how it works in PostGIS, only that we moved to more > effecient Hilbert curve: > https://github.com/postgis/postgis/blob/54399b9f6b0f02e8db9444f9f042b8d4ca6d4fa4/postgis/lwgeom_btree.c#L171 Thanks, that's interesting. I implemented the abbreviated keys for the point opclass, too, and noticed that the patch as it was never used it. I reworked the patch so that tuplesort_begin_index_gist() is responsible for looking up the sortsupport function, like tuplesort_begin_index_btree() does, and uses abbreviation when possible. I think this is pretty much ready for commit now. I'll do a bit more testing (do we have regression test coverage for this?), also on a SIZEOF_DATUM==4 system since the abbreviation works differently with that, and push if nothing new comes up. And clarify the documentation and/or comments that the sortsupport function sees "compressed" values. I wonder if we could use sorting to also speed up building tsvector indexes? The values stored there are bit signatures, what would be a good sort order for those? - Heikki
Commits
-
Add sortsupport for gist_btree opclasses, for faster index builds.
- 9f984ba6d23d 14.0 landed
-
pageinspect: Fix relcache leak in gist_page_items().
- 04eb75e783ba 14.0 landed
-
Fix test failure with wal_level=minimal.
- 5abca4b1cd71 14.0 landed
-
Enhance nbtree index tuple deletion.
- d168b666823b 14.0 cited
-
Fix portability issues in the new gist pageinspect test.
- 6ecaaf810b8b 14.0 landed
-
Add functions to 'pageinspect' to inspect GiST indexes.
- 756ab29124d7 14.0 landed
-
Fix missing validation for the new GiST sortsupport functions.
- 6f0bc5e1daf0 14.0 landed
-
Fix compilation warning in xlog.c
- 0a3c864c3275 14.0 cited
-
Set right-links during sorted GiST index build.
- 265ea567852a 14.0 landed
-
Fix checksum calculation in the new sorting GiST build.
- c47a240fe6db 14.0 landed
-
Add support for building GiST index by sorting.
- 16fa9b2b30a3 14.0 landed