Re: postgres_fdw: oddity in costing aggregate pushdown paths
Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>
From: Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>
To: Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2019-01-04T11:33:48Z
Lists: pgsql-hackers
Attachments
- fix-estimate_path_cost_size.patch (text/x-patch) patch
(2018/12/28 17:28), Etsuro Fujita wrote: > I noticed that I forgot to modify the cost for evaluating the PathTarget > for each output row accordingly to this change :(. Attached is a patch > for that. On reflection, I noticed these on estimate_path_cost_size, other than that: 1) In the case of a foreign-grouping path, we failed to adjust the PathTarget eval cost when using the remote estimates, which I think would be needed because the PathTarget expressions cannot always be pre-computed as entries of the fdw_scan_tlist for the foreign-grouping path. 2) We also failed to factor in the eval cost for the foreign-scan and foreign-join cases, with/without the remote estimates; in the scan/join cases, the PathTarget might contain PHVs, so the cost of evaluating PHVs should be charged. Currently, PHVs are evaluated locally, so the cost of PHV expressions should also be factored in when using the remote estimates. Here is a new version of the patch. Best regards, Etsuro Fujita
Commits
-
postgres_fdw: Account for tlist eval costs in estimate_path_cost_size().
- fd1afdbafd4f 12.0 landed
-
postgres_fdw: Improve cost and size estimation for aggregate pushdown.
- f8f6e44676ef 12.0 landed
-
Teach planner to account for HAVING quals in aggregation plan nodes.
- 7b6c07547190 11.0 cited