Re: Cube extension kNN support
От | Alexander Korotkov |
---|---|
Тема | Re: Cube extension kNN support |
Дата | |
Msg-id | CAPpHfdugQB1iiLCO+=BRhP5R5-DhumsZaZwKRtYNcq58UKTVpA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Cube extension kNN support (Stas Kelvich <stas.kelvich@gmail.com>) |
Ответы |
Re: Cube extension kNN support
|
Список | pgsql-hackers |
Hi!
On Sat, Feb 7, 2015 at 12:45 PM, Stas Kelvich <stas.kelvich@gmail.com> wrote:
------
With best regards,
Alexander Korotkov.
I had updated old patch with kNN operators for cube data structures. Copying description from old message:
Following distance operators introduced:
<#> taxicab distance
<-> euclidean distance
<=> chebyshev distance
For example:
SELECT * FROM objects ORDER BY objects.coord <-> '(137,42,314)'::cube LIMIT 10;
Also there is operator "->" for selecting ordered rows directly from index.
This request selects rows ordered ascending by 3rd coordinate:
SELECT * FROM objects ORDER BY objects.coord->3 LIMIT 10;
For descendent ordering suggested syntax with minus before coordinate.
This request selects rows ordered descending by 4th coordinate:
SELECT * FROM objects ORDER BY objects.coord->-4 LIMIT 10;
I've checked the patch. The first notes are so:
1) Check coding style, in particular braces. Postgres coding style require using it for multiline statements.
2) Update documentation according to new features.
With best regards,
Alexander Korotkov.
В списке pgsql-hackers по дате отправления: