Re: Yet another fast GiST build

Pavel Borisov <pashkin.elfe@gmail.com>

From: Pavel Borisov <pashkin.elfe@gmail.com>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: "Andrey M. Borodin" <x4mmm@yandex-team.ru>, Thomas Munro <thomas.munro@gmail.com>, Michael Paquier <michael@paquier.xyz>, Alexander Korotkov <a.korotkov@postgrespro.ru>, Darafei Komяpa Praliaskouski <me@komzpa.net>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2020-09-07T10:59:30Z
Lists: pgsql-hackers
>
>
> >> I suppose there is a big jump in integer value (whether signed or
> >> unsigned) as you cross from positive to negative floats, and then the
> >> sort order is reversed.  I have no idea if either of those things is a
> >> problem worth fixing.  That made me wonder if there might also be an
>
> I took a stab at fixing this, see attached patch (applies on top of your
> patch v14).
>
> To evaluate this, I used the other attached patch to expose the zorder
> function to SQL, and plotted points around zero with gnuplot. See the
> attached two images, one with patch v14, and the other one with this patch.
>

I'd made testing of sorted SpGist build in cases of points distributed only
in 2d quadrant and points in all 4 quadrants and it appears that this
abnormality doesn't affect as much as Andrey supposed. But Heikki's patch
is really nice way to avoid what can be avoided and I'd like it is included
together with Andrey's patch.

Pavel.

Commits

  1. Add sortsupport for gist_btree opclasses, for faster index builds.

  2. pageinspect: Fix relcache leak in gist_page_items().

  3. Fix test failure with wal_level=minimal.

  4. Enhance nbtree index tuple deletion.

  5. Fix portability issues in the new gist pageinspect test.

  6. Add functions to 'pageinspect' to inspect GiST indexes.

  7. Fix missing validation for the new GiST sortsupport functions.

  8. Fix compilation warning in xlog.c

  9. Set right-links during sorted GiST index build.

  10. Fix checksum calculation in the new sorting GiST build.

  11. Add support for building GiST index by sorting.