Re: ToDo: KNN Search should to support DISTINCT clasuse? - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: ToDo: KNN Search should to support DISTINCT clasuse?
Date
Msg-id 20121025153507.306900@gmx.com
Whole thread Raw
In response to ToDo: KNN Search should to support DISTINCT clasuse?  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: ToDo: KNN Search should to support DISTINCT clasuse?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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?

-Kevin



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: autovacuum truncate exclusive lock round two
Next
From: Tom Lane
Date:
Subject: Re: [9.1] 2 bugs with extensions