Re: KNNGiST for knn-search

Teodor Sigaev <teodor@sigaev.ru>

From: Teodor Sigaev <teodor@sigaev.ru>
To: Simon Riggs <simon@2ndQuadrant.com>
Cc: Pgsql Hackers <pgsql-hackers@postgresql.org>
Date: 2009-11-26T16:37:13Z
Lists: pgsql-hackers
>   explain select col1 from s order by abs(col1 - 5) limit 10;
> 
> is the one-dimensional equivalent of the type of query you're proposing
Exactly, it's already done in next version of patch :)

> and that doesn't work either until you put an index on abs(col1 - 5),
> then it just works, but only for k = 5.

BTW, it's possible to add this feature to plain btree by changing traversal 
algorithm, but I'm fill enough power to do it.


-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
                                                    WWW: http://www.sigaev.ru/