pgsql: Don't zero tuple_fraction when planning UNIONs with ORDER BYs

From: David Rowley <drowley(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Don't zero tuple_fraction when planning UNIONs with ORDER BYs
Date: 2024-04-02 22:40:57
Message-ID: E1rrmoK-000Bwi-Km@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Don't zero tuple_fraction when planning UNIONs with ORDER BYs

Since 66c0185a3, the planner is able to use Merge Append -> Unique to
implement UNION queries and each subquery is prompted to produce Paths
correctly sorted by the UNION's targetlist.

Here we remove some now redundant code which was zeroing the
tuple_fraction at the parent level. This will allow the planner to
consider cheap startup paths when planning the UNION's subqueries.

EXCEPT and INTERSECT set operations still have the tuple_fraction zeroed
in generate_nonunion_paths(). These operations currently always read
all of their subqueries' tuples.

Reported-by: Tom Lane
Discussion: https://postgr.es/m/3703023.1711654574@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3b1a7eb28930e9835cda5e42256b7ccc2d044d41

Modified Files
--------------
src/backend/optimizer/plan/planner.c | 11 -----------
1 file changed, 11 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Thomas Munro 2024-04-02 23:23:50 Re: pgsql: Implement pg_wal_replay_wait() stored procedure
Previous Message Alexander Korotkov 2024-04-02 21:40:30 Re: pgsql: Allow SIGINT to cancel psql database reconnections.