Re: Apply the "LIMIT 1" optimization to partial DISTINCT

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Apply the "LIMIT 1" optimization to partial DISTINCT
Date: 2024-01-31 04:25:48
Message-ID: CAApHDvpx2+JEaubSEw75RHvjvjF=g4X3hcty=Tk71Zov9WZ_Dw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 26 Jan 2024 at 21:14, David Rowley <dgrowleyml(at)gmail(dot)com> wrote:
> However, having said that. Parallel plans are often picked when there
> is some highly selective qual as parallel_tuple_cost has to be applied
> to fewer tuples for such plans, so probably this is worth doing.

I was messing around with your test case and didn't manage to get any
plan that had any rows to use the partial path with the LIMIT. I
ended up dropping the test that was checking the results were empty as
I didn't think it added much more value over the EXPLAIN output.

I pushed the result.

Thanks for working on this.

David

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2024-01-31 04:56:50 src/bin/pg_upgrade/t/004_subscription.pl test comment fix
Previous Message Tom Lane 2024-01-31 04:25:28 Re: Possibility to disable `ALTER SYSTEM`