pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix minmax-multi distance for extreme interval values
Date: Fri, 27 Oct 2023 16:57:46 +0000
Message-ID: <E1qwQ9Z-002dHQ-Nw@gemulon.postgresql.org> (raw)

Fix minmax-multi distance for extreme interval values

When calculating distance for interval values, the code mostly mimicked
interval_mi, i.e. it built a new interval value for the difference.
That however does not work for sufficiently distant interval values,
when the difference overflows the interval range.

Instead, we can calculate the distance directly, without constructing
the intermediate (and unnecessary) interval value.

Backpatch to 14, where minmax-multi indexes were introduced.

Reported-by: Dean Rasheed
Reviewed-by: Ashutosh Bapat, Dean Rasheed
Backpatch-through: 14
Discussion: https://postgr.es/m/eef0ea8c-4aaa-8d0d-027f-58b1f35dd170@enterprisedb.com

Branch
------
master

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

Modified Files
--------------
src/backend/access/brin/brin_minmax_multi.c | 33 ++++-------------------------
src/test/regress/expected/brin_multi.out    | 29 +++++++++++++++++++++++++
src/test/regress/sql/brin_multi.sql         | 21 ++++++++++++++++++
3 files changed, 54 insertions(+), 29 deletions(-)



view thread (4+ messages)  latest in thread

Message-ID: <E1qwQ9Z-002dHQ-Nw@gemulon.postgresql.org>
Permalink:  ../E1qwQ9Z-002dHQ-Nw@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1qwQ9Z-002dHQ-Nw@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: tomas.vondra@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix minmax-multi distance for extreme interval values
  In-Reply-To: <E1qwQ9Z-002dHQ-Nw@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