pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dean Rasheed <dean.a.rasheed@gmail.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: btree_gin: Fix calculation of leftmost interval value.
Date: Sun, 29 Oct 2023 11:23:35 +0000
Message-ID: <E1qx3tH-002wWQ-26@gemulon.postgresql.org> (raw)

btree_gin: Fix calculation of leftmost interval value.

Formerly, the value computed by leftmostvalue_interval() was a long
way short of the minimum possible interval value.  As a result, an
index scan on a GIN index on an interval column with < or <= operators
would miss large negative interval values.

Fix by setting all fields of the leftmost interval to their minimum
values, ensuring that the result is less than any other possible
interval.  Since this only affects index searches, no index rebuild is
necessary.

Back-patch to all supported branches.

Dean Rasheed, reviewed by Heikki Linnakangas.

Discussion: https://postgr.es/m/CAEZATCV80%2BgOfF8ehNUUfaKBZgZMDfCfL-g1HhWGb6kC3rpDfw%40mail.gmail.com

Branch
------
REL_12_STABLE

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

Modified Files
--------------
contrib/btree_gin/btree_gin.c           |  6 +++---
contrib/btree_gin/expected/interval.out | 16 +++++++++++-----
contrib/btree_gin/sql/interval.sql      |  4 +++-
3 files changed, 17 insertions(+), 9 deletions(-)



view thread (7+ messages)  latest in thread

Message-ID: <E1qx3tH-002wWQ-26@gemulon.postgresql.org>
Permalink:  ../E1qx3tH-002wWQ-26@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1qx3tH-002wWQ-26@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: dean.a.rasheed@gmail.com, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: btree_gin: Fix calculation of leftmost interval value.
  In-Reply-To: <E1qx3tH-002wWQ-26@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