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

From: "Kevin Grittner" <kgrittn(at)mail(dot)com>
To: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>,"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "PostgreSQL Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ToDo: KNN Search should to support DISTINCT clasuse?
Date: 2012-10-25 15:35:07
Message-ID: 20121025153507.306900@gmx.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Pavel Stehule wrote:
> 2012/10/22 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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' limit 10;

> 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2012-10-25 15:37:07 Re: proposal - assign result of query to psql variable
Previous Message Amit kapila 2012-10-25 15:31:18 Re: [WIP PATCH] for Performance Improvement in Buffer Management