Re: [PATCH] Add sortsupport for range types and btree_gist

x4mmm@yandex-team.ru

From: Andrey Borodin <x4mmm@yandex-team.ru>
To: Bernd Helmle <mailings@oopsware.de>
Cc: Michael Paquier <michael@paquier.xyz>, jian he <jian.universality@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-11-30T17:18:38Z
Lists: pgsql-hackers

> On 30 Nov 2024, at 18:14, Bernd Helmle <mailings@oopsware.de> wrote:
> 
> I don't like this. This smells like we use the wrong tool. Andrey had
> the idea to use them because it looked as a compelling idea to check
> whether sortsupport is used in the code path or not. 
> 
> Maybe we should just use a specific DEBUG message and make sure it's
> handled by the tests accordingly.

We tried to go that route, random DEBUG1 lines were breaking tests (autovacuum or something like that, there was something non-deterministic). I think we can dig exact reason from 2021 thread why we abandoned that idea...

I think we have two options:
1. Just do not commit tests. We ran it manually, saw that paths are taken, we are happy.
2. Have just one file that builds sorted index on a table with few tuples for each data type.

We do not need to test that core sorting (or buffered) build works. AFAIR there's plenty of other tests to verify that.

Injection points seemed to me exactly the technogy that could help us to have tests for this patch. But at this point It looks like it's reasonable to take approach 1, as we did before.


Best regards, Andrey Borodin.


Commits

  1. Add support for sorted gist index builds to btree_gist

  2. Add GiST and btree sortsupport routines for range types

  3. Change gist stratnum function to use CompareType

  4. Doc: improve documentation for jsonpath behavior.

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