From: Teodor Sigaev <teodor@sigaev.ru>
To: pgsql-committers@postgresql.org
Subject: pgsql: Fix behavior of ~> (cube, int) operator
Date: Thu, 11 Jan 2018 11:41:33 +0000
Message-ID: <E1eZbEj-0000Zi-Hl@gemulon.postgresql.org> (raw)
Fix behavior of ~> (cube, int) operator
~> (cube, int) operator was especially designed for knn-gist search.
However, it appears that knn-gist search can't work correctly with current
behavior of this operator when dataset contains cubes of variable
dimensionality. In this case, the same value of second operator argument
can point to different dimension depending on dimensionality of particular cube.
Such behavior is incompatible with gist indexing of cubes, and knn-gist doesn't
work correctly for it.
This patch changes behavior of ~> (cube, int) operator by introducing dimension
numbering where value of second argument unambiguously identifies number of
dimension. With new behavior, this operator can be correctly supported by
knn-gist. Relevant changes to cube operator class are also included.
Backpatch to v9.6 where operator was introduced.
Since behavior of ~> (cube, int) operator is changed, depending entities
must be refreshed after upgrade. Such as, expression indexes using this
operator must be reindexed, materialized views must be rebuilt, stored
procedures and client code must be revised to correctly use new behavior.
That should be mentioned in release notes.
Noticed by: Tomas Vondra
Author: Alexander Korotkov
Reviewed by: Tomas Vondra, Andrey Borodin
Discussion: https://www.postgresql.org/message-id/flat/a9657f6a-b497-36ff-e56-482a2c7e3292@2ndquadrant.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/563a053bdd4b91c5e5560f4bf91220e562326f7d
Modified Files
--------------
contrib/cube/cube.c | 120 ++++++++++++---
contrib/cube/expected/cube.out | 317 ++++++++++++++++++++++++---------------
contrib/cube/expected/cube_2.out | 317 ++++++++++++++++++++++++---------------
contrib/cube/sql/cube.sql | 35 +++--
doc/src/sgml/cube.sgml | 9 +-
5 files changed, 512 insertions(+), 286 deletions(-)
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: teodor@sigaev.ru
Subject: Re: pgsql: Fix behavior of ~> (cube, int) operator
In-Reply-To: <E1eZbEj-0000Zi-Hl@gemulon.postgresql.org>
References: <E1eZbEj-0000Zi-Hl@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