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

From Ants Aasma
Subject Re: ToDo: KNN Search should to support DISTINCT clasuse?
Date
Msg-id CA+CSw_u6P4Js1YHjDiD=GAZhuzMpEVsxv2UJo4FHYv+gCkz0WQ@mail.gmail.com
Whole thread Raw
In response to Re: ToDo: KNN Search should to support DISTINCT clasuse?  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Tue, Oct 23, 2012 at 7:25 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> through the end of the input.  However, when the HashAgg node is only
> implementing DISTINCT (ON), you can emit each new row as soon as you
> see it, and just make the hash table entry to be certain you don't
> emit it again.  I think someone recently submitted a patch along these
> lines and we rejected it because the use case was too thin ... but
> this example is making me think that the use case might not be all
> that thin after all.

If anyone wants to play around, the initial patch is available here:


http://archives.postgresql.org/message-id/CA%2BCSw_uE-RCyQd_bXJNe%3DusrXkq%2BkeFrQrahkc%2B8ou%2BWs4Y%3DVw%40mail.gmail.com

It looks to me like it should work for the distinct on KNN search case
out of the box. However it needs some planner adjustment for more
complex plans and maybe some refactoring to lose duplication in the
executor to be worth considering committing.

Regards,
Ants Aasma



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Re: [WIP] Performance Improvement by reducing WAL for Update Operation
Next
From: Alvaro Herrera
Date:
Subject: Re: Extend argument of OAT_POST_CREATE