From f50c80dbb17efa39c169f6c510e9464486ff5edc Mon Sep 17 00:00:00 2001 From: Teodor Sigaev Date: Thu, 11 Jan 2018 14:49:36 +0300 Subject: llow negative coordinate for ~> (cube, int) operator ~> (cube, int) operator was especially designed for knn-gist search. However, knn-gist supports only ascending ordering of results. Nevertheless it would be useful to support descending ordering by ~> (cube, int) operator. We provide workaround for that: negative coordinate give us inversed value of corresponding cube bound. Therefore, knn search using negative coordinate gives us an effect of descending ordering by cube bound. 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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/cube.sgml b/doc/src/sgml/cube.sgml index 9cda8cac972..e010305d848 100644 --- a/doc/src/sgml/cube.sgml +++ b/doc/src/sgml/cube.sgml @@ -189,8 +189,9 @@ 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. + k-th dimension. Negative + n denotes inversed value of corresponding + positive coordinate. This operator is designed for KNN-GiST support. -- cgit v1.2.3