Re: knngist - 0.8

From: Teodor Sigaev <teodor(at)sigaev(dot)ru>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: knngist - 0.8
Date: 2010-10-22 10:58:24
Message-ID: 4CC16E50.90104@sigaev.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> You can define the additional argument as providing all of the extra
> info about how the operator is being used, and, if it's being used for
> ordering, the details of the requested order. What is your thinking
> on the matter?

Maby be useful, but it seems to me to be a bit overengineering for now. GiST
will not support knn-search with different than ASC NULLS LAST order in foresee
future, because it stores NULLs in unmaintainable manner for different ordering:
NULLs could be everywhere in tree. So, implementation of ASC NULLS FIRST
requires to read whole tree to find all NULLs value first. I can imagine, how to
reorganize tree to store NULLs together for single-column index, but not for
multi-column index. Orders DESC NULLS LAST/FIRST requires to introduce two more
"infinite" values: one to notion of distance more than +INF and another,
non-negative, but less than zero distance.

Again, it could be useful for modification of GiST known as ordered GiST. But
ordered GiST uses completely different tree traversal algorithm for search and
insert, and it hasn't any benefits comparing with B-Tree and GiST. It's looks
like an autogiro which successfully combines disadvantages of airplanes and
helicopters :)
--
Teodor Sigaev E-mail: teodor(at)sigaev(dot)ru
WWW: http://www.sigaev.ru/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Leonardo Francalanci 2010-10-22 13:02:48 Custom aggragation function that creates an array
Previous Message Teodor Sigaev 2010-10-22 10:31:40 Re: gist DatumGetPointer returns pointer to corrupted data