pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Rowley <drowley@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Don't zero tuple_fraction when planning UNIONs with ORDER BYs
Date: Tue, 02 Apr 2024 22:40:57 +0000
Message-ID: <E1rrmoK-000Bwi-Km@gemulon.postgresql.org> (raw)

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(-)



Message-ID: <E1rrmoK-000Bwi-Km@gemulon.postgresql.org>
Permalink:  ../E1rrmoK-000Bwi-Km@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rrmoK-000Bwi-Km@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: drowley@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Don't zero tuple_fraction when planning UNIONs with ORDER BYs
  In-Reply-To: <E1rrmoK-000Bwi-Km@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox