pgsql: llow negative coordinate for ~> (cube, int) operator

From: Teodor Sigaev <teodor(at)sigaev(dot)ru>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: llow negative coordinate for ~> (cube, int) operator
Date: 2018-01-11 11:49:54
Message-ID: E1eZbMo-0000ir-S7@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)2ndquadrant(dot)com

Branch
------
master

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

Modified Files
--------------
contrib/cube/cube.c | 44 ++++++++--
contrib/cube/expected/cube.out | 168 ++++++++++++++++++++++++++++++++++++++-
contrib/cube/expected/cube_2.out | 168 ++++++++++++++++++++++++++++++++++++++-
contrib/cube/sql/cube.sql | 8 ++
doc/src/sgml/cube.sgml | 5 +-
5 files changed, 379 insertions(+), 14 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2018-01-11 13:32:18 pgsql: Fix Latin spelling
Previous Message Teodor Sigaev 2018-01-11 11:43:25 pgsql: Fix behavior of ~> (cube, int) operator