pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add planner support functions for range operators <@ and @>.
Date: Sat, 20 Jan 2024 18:58:02 +0000
Message-ID: <E1rRGXa-002KnM-1p@gemulon.postgresql.org> (raw)

Add planner support functions for range operators <@ and @>.

These support functions will transform expressions with constant
range values into direct comparisons on the range bound values,
which are frequently better-optimizable.  The transformation is
skipped however if it would require double evaluation of a
volatile or expensive element expression.

Along the way, add the range opfamily OID to range typcache entries,
since load_rangetype_info has to compute that anyway and it seems
silly to duplicate the work later.

Kim Johan Andersson and Jian He, reviewed by Laurenz Albe

Discussion: https://postgr.es/m/94f64d1f-b8c0-b0c5-98bc-0793a34e0851@kimmet.dk

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/075df6b2080b13e0a5adc88737b7c24417a873c1

Modified Files
--------------
src/backend/utils/adt/rangetypes.c          | 244 +++++++++++++++++++++++++++-
src/backend/utils/adt/rangetypes_selfuncs.c |   7 +-
src/backend/utils/cache/typcache.c          |   1 +
src/include/catalog/catversion.h            |   2 +-
src/include/catalog/pg_proc.dat             |  14 +-
src/include/utils/typcache.h                |   1 +
src/test/regress/expected/rangetypes.out    | 142 ++++++++++++++++
src/test/regress/sql/rangetypes.sql         |  69 ++++++++
8 files changed, 469 insertions(+), 11 deletions(-)



Message-ID: <E1rRGXa-002KnM-1p@gemulon.postgresql.org>
Permalink:  ../E1rRGXa-002KnM-1p@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rRGXa-002KnM-1p@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add planner support functions for range operators <@ and @>.
  In-Reply-To: <E1rRGXa-002KnM-1p@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox