Re: Use LIMIT instead of Unique for DISTINCT when all distinct pathkeys are redundant

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Use LIMIT instead of Unique for DISTINCT when all distinct pathkeys are redundant
Date: 2022-10-13 03:39:50
Message-ID: CAMbWs49ARdmTAbjNLU7tKgGiSerP8vdcFgsu7ZJvBY_pe7FP=g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 13, 2022 at 4:41 AM David Rowley <dgrowleyml(at)gmail(dot)com> wrote:

> We could do something like set some bool flag in PlannerInfo to tell
> the planner not to bother adding the final LimitPath as we've already
> added another which does the job, but is it really worth adding that
> complexity for this patch? You already mentioned that "this patch is
> very straightforward". I don't think it would be if we added code to
> avoid the LimitPath duplication.

Yeah, maybe this is the right way to do it. I agree that this would
complicate the code. Not sure if it's worth doing.

Thanks
Richard

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Guo 2022-10-13 03:47:02 Re: Use LIMIT instead of Unique for DISTINCT when all distinct pathkeys are redundant
Previous Message Tom Lane 2022-10-13 03:34:32 Re: how to correctly react on exception in pfree function?