Re: ToDo: KNN Search should to support DISTINCT clasuse?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: ToDo: KNN Search should to support DISTINCT clasuse?
Дата
Msg-id 802.1351184176@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: ToDo: KNN Search should to support DISTINCT clasuse?  ("Kevin Grittner" <kgrittn@mail.com>)
Список pgsql-hackers
"Kevin Grittner" <kgrittn@mail.com> writes:
> Pavel Stehule wrote:
>> 2012/10/22 Tom Lane <tgl@sss.pgh.pa.us>:
>>> Perhaps it would be close enough to what you want to use DISTINCT ON:
>>> contrib_regression=# explain select distinct on( t <-> 'foo') *,t <-> 'foo' from test_trgm order by t <-> 'foo'
limit10;
 

>> good tip - it's working

> If two or more values happen to be at exactly the same distance,
> wouldn't you just get one of them?

Yeah, that is a hazard.  I'm not sure whether <->'s results are
sufficiently quantized to make that a big problem in practice.
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [9.1] 2 bugs with extensions
Следующее
От: "David E. Wheeler"
Дата:
Сообщение: Extensions Documentation