From b8279a783dafb7c715b3835d4c9244d3451c4c1a Mon Sep 17 00:00:00 2001 From: Teodor Sigaev Date: Thu, 11 Jan 2018 14:42:16 +0300 Subject: 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 --- doc/src/sgml/cube.sgml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/cube.sgml b/doc/src/sgml/cube.sgml index 1ffc40f1a5b..3d503719c59 100644 --- a/doc/src/sgml/cube.sgml +++ b/doc/src/sgml/cube.sgml @@ -186,10 +186,11 @@ a ~> n float8 - Get n-th coordinate in normalized cube - representation, in which the coordinates have been rearranged into - the form lower left — upper right; that is, the - smaller endpoint along each dimension appears first. + Get n-th coordinate of cube in following way: + n = 2 * k - 1 means lower bound of k-th + dimension, n = 2 * k means upper bound of + k-th dimension. This operator is designed + for KNN-GiST support. -- cgit v1.2.3