Re: Should total_pages be calculated after partition pruning and constraint exclusion? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Should total_pages be calculated after partition pruning and constraint exclusion?
Date
Msg-id 3065.1526415058@sss.pgh.pa.us
Whole thread Raw
In response to Should total_pages be calculated after partition pruning andconstraint exclusion?  (David Rowley <david.rowley@2ndquadrant.com>)
Responses Re: Should total_pages be calculated after partition pruning andconstraint exclusion?  (David Rowley <david.rowley@2ndquadrant.com>)
List pgsql-hackers
David Rowley <david.rowley@2ndquadrant.com> writes:
> It seems quite strange to me that we calculate total_pages before any
> partition pruning and constraint exclusion is performed during
> set_base_rel_sizes(). Wouldn't it be better to wait until after that's
> done so we don't mistakenly count relations we're not going to scan?

> Delaying the calculation until after set_base_rel_sizes() means it's
> still done in time before it's needed in set_base_rel_pathlists().

I think that when this was first done, there was not a separation between
those passes over the rangetable, so that such a simple fix would have
been impossible.

> The attached patch implements the change.

Please add to next CF.  It's a bit late to be doing such things in v11,
IMO.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Postgres 11 release notes
Next
From: Robert Haas
Date:
Subject: Re: explain (verbose off, normalized) vs query planid