postgresql/contrib/cube
Teodor Sigaev 563a053bdd 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
2018-01-11 14:41:14 +03:00
..
data
expected Fix behavior of ~> (cube, int) operator 2018-01-11 14:41:14 +03:00
sql Fix behavior of ~> (cube, int) operator 2018-01-11 14:41:14 +03:00
.gitignore Support "make check" in contrib 2011-04-25 22:27:11 +03:00
CHANGES Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
cube--1.0--1.1.sql Fix whitespace 2015-12-19 11:46:38 -05:00
cube--1.1--1.2.sql Update extensions with GIN/GIST support for parallel query. 2016-06-14 13:34:37 -04:00
cube--1.2--1.3.sql Distinguish selectivity of < from <= and > from >=. 2017-09-13 11:12:39 -04:00
cube--1.2.sql Update extensions with GIN/GIST support for parallel query. 2016-06-14 13:34:37 -04:00
cube--1.3--1.4.sql Support index-only scans in contrib/cube and contrib/seg GiST indexes. 2017-11-20 20:25:18 -05:00
cube--unpackaged--1.0.sql Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:37 +02:00
cube.c Fix behavior of ~> (cube, int) operator 2018-01-11 14:41:14 +03:00
cube.control Support index-only scans in contrib/cube and contrib/seg GiST indexes. 2017-11-20 20:25:18 -05:00
cubedata.h Make DatumGetFoo/PG_GETARG_FOO/PG_RETURN_FOO macro names more consistent. 2017-09-18 15:21:23 -04:00
cubeparse.y Improve contrib/cube's handling of zero-D cubes, infinities, and NaNs. 2016-09-27 11:38:33 -04:00
cubescan.l Exclude flex-generated code from coverage testing 2017-10-16 16:28:11 -04:00
Makefile Support index-only scans in contrib/cube and contrib/seg GiST indexes. 2017-11-20 20:25:18 -05:00