Add missing operator <->(box, point) - Mailing list pgsql-hackers

From Nikita Glukhov
Subject Add missing operator <->(box, point)
Date
Msg-id f71ba19d-d989-63b6-f04a-abf02ad9345d@postgrespro.ru
Whole thread Raw
Responses Re: Add missing operator <->(box, point)
Re: Add missing operator <->(box, point)
List pgsql-hackers
Hi, hackers.

Attached patches add missing distance operator <->(box, point).

We already have reverse operator <->(point, box), but it can't be used for kNN 
search in GiST and SP-GiST.  GiST and SP-GiST now support kNN searches over more 
complex polygons and circles, but do not support more simple boxes, which seems 
to be inconsistent.

Description of the patches:
1. Add function dist_pb(box, point) and operator <->.

2. Add <-> to GiST box_ops.    Extracted gist_box_distance_helper() common for gist_box_distance() and   gist_bbox_distance().

3. Add <-> to SP-GiST.    Changed only catalog and tests.  Box case is already checked in  spg_box_quad_leaf_consistent():    out->recheckDistances = distfnoid == F_DIST_POLYP;


--
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Attachment

pgsql-hackers by date:

Previous
From: ilmari@ilmari.org (Dagfinn Ilmari Mannsåker)
Date:
Subject: Re: pgbench MAX_ARGS
Next
From: Peter Geoghegan
Date:
Subject: Re: Making all nbtree entries unique by having heap TIDs participatein comparisons