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

From Fabien COELHO
Subject Re: Add missing operator <->(box, point)
Date
Msg-id alpine.DEB.2.21.1904201526100.29102@lancre
Whole thread Raw
In response to Add missing operator <->(box, point)  (Nikita Glukhov <n.gluhov@postgrespro.ru>)
Responses Re: Add missing operator <->(box, point)
List pgsql-hackers
Hello Nikita,

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

Indeed.

> 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 <->.

About this first patch: applies cleanly, compiles, "make check" ok.

No doc changes, but this was expected to work in the first place, 
according to the documention.

About the test, I'd suggest to name the result columns, eg "pt to box 
dist" and "box to pt dist", otherwise why all is repeated is unclear.

I notice that other distance tests do not test for commutativity. Are they 
also not implemented, or just not tested? If not implemented, I'd suggest 
to add them in the same batch. If not tested, maybe the patch should do as 
others, or maybe given the trivial implementation there should just be one 
test per commutted operator for coverage.

ISTM that the committer would need to "bump the catalog revision number" 
because it adds new functions & operators.

-- 
Fabien.



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: finding changed blocks using WAL scanning
Next
From: Tom Lane
Date:
Subject: Re: TM format can mix encodings in to_char()