pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Korotkov <akorotkov@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix handling of NULL distances in KNN-GiST
Date: Sun, 08 Sep 2019 19:30:50 +0000
Message-ID: <E1i72te-0001Q3-VS@gemulon.postgresql.org> (raw)

Fix handling of NULL distances in KNN-GiST

In order to implement NULL LAST semantic GiST previously assumed distance to
the NULL value to be Inf.  However, our distance functions can return Inf and
NaN for non-null values.  In such cases, NULL LAST semantic appears to be
broken.  This commit fixes that by introducing separate array of null flags for
distances.

Backpatch to all supported versions.

Discussion: https://postgr.es/m/CAPpHfdsNvNdA0DBS%2BwMpFrgwT6C3-q50sFVGLSiuWnV3FqOJuQ%40mail.gmail.com
Author: Alexander Korotkov
Backpatch-through: 9.4

Branch
------
REL_11_STABLE

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

Modified Files
--------------
src/backend/access/gist/gistget.c  | 77 +++++++++++++++++++++++++-------------
src/backend/access/gist/gistscan.c | 25 +++++++++++--
src/include/access/gist_private.h  | 26 +++++++++++--
3 files changed, 95 insertions(+), 33 deletions(-)



view thread (7+ messages)  latest in thread

Message-ID: <E1i72te-0001Q3-VS@gemulon.postgresql.org>
Permalink:  ../E1i72te-0001Q3-VS@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1i72te-0001Q3-VS@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: akorotkov@postgresql.org
  Subject: Re: pgsql: Fix handling of NULL distances in KNN-GiST
  In-Reply-To: <E1i72te-0001Q3-VS@gemulon.postgresql.org>
  References: <E1i72te-0001Q3-VS@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