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: Improve handling of NULLs in KNN-GiST and KNN-SP-GiST
Date: Thu, 19 Sep 2019 19:11:31 +0000
Message-ID: <E1iB1pz-00077u-J4@gemulon.postgresql.org> (raw)

Improve handling of NULLs in KNN-GiST and KNN-SP-GiST

This commit improves subject in two ways:

 * It removes ugliness of 02f90879e7, which stores distance values and null
   flags in two separate arrays after GISTSearchItem struct.  Instead we pack
   both distance value and null flag in IndexOrderByDistance struct.  Alignment
   overhead should be negligible, because we typically deal with at most few
   "col op const" expressions in ORDER BY clause.
 * It fixes handling of "col op NULL" expression in KNN-SP-GiST.  Now, these
   expression are not passed to support functions, which can't deal with them.
   Instead, NULL result is implicitly assumed.  It future we may decide to
   teach support functions to deal with NULL arguments, but current solution is
   bugfix suitable for backpatch.

Reported-by: Nikita Glukhov
Discussion: https://postgr.es/m/826f57ee-afc7-8977-c44c-6111d18b02ec%40postgrespro.ru
Author: Nikita Glukhov
Reviewed-by: Alexander Korotkov
Backpatch-through: 9.4

Branch
------
REL9_5_STABLE

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

Modified Files
--------------
src/backend/access/gist/gistget.c  | 75 ++++++++++++++------------------------
src/backend/access/gist/gistscan.c | 16 +++-----
src/include/access/genam.h         |  7 ++++
src/include/access/gist_private.h  | 28 ++++----------
src/tools/pgindent/typedefs.list   |  1 +
5 files changed, 48 insertions(+), 79 deletions(-)



view thread (14+ messages)  latest in thread

Message-ID: <E1iB1pz-00077u-J4@gemulon.postgresql.org>
Permalink:  ../E1iB1pz-00077u-J4@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1iB1pz-00077u-J4@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: Improve handling of NULLs in KNN-GiST and KNN-SP-GiST
  In-Reply-To: <E1iB1pz-00077u-J4@gemulon.postgresql.org>
  References: <E1iB1pz-00077u-J4@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