pgsql: Add GiST and btree sortsupport routines for range types

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add GiST and btree sortsupport routines for range types
Date: 2025-04-02 17:18:25
Message-ID: E1u01jN-002KWz-1X@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add GiST and btree sortsupport routines for range types

For GiST, having a sortsupport function allows building the index
using the "sorted build" method, which is much faster.

For b-tree, the sortsupport routine doesn't give any new
functionality, but speeds up sorting a tiny bit. The difference is not
very significant, about 2% in cursory testing on my laptop, because
the range type comparison function has quite a lot of overhead from
detoasting. In any case, since we have the function for GiST anyway,
we might as well register it for the btree opfamily too.

Author: Bernd Helmle <mailings(at)oopsware(dot)de>
Discussion: https://www.postgresql.org/message-id/64d324ce2a6d535d3f0f3baeeea7b25beff82ce4.camel@oopsware.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e9e7b66044c9e3dfa76fd1599d5703acd3e4a3f5

Modified Files
--------------
src/backend/utils/adt/rangetypes.c | 64 ++++++++++++++++++++++++++++++++++++++
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_amproc.dat | 6 ++++
src/include/catalog/pg_proc.dat | 3 ++
4 files changed, 74 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2025-04-02 18:06:23 pgsql: Change SQL-language functions to use the plan cache.
Previous Message Tom Lane 2025-04-02 15:27:50 Re: pgsql: docs: Fix column count attribute in table