Re: postgres_fdw: oddity in costing aggregate pushdown paths - Mailing list pgsql-hackers

From Etsuro Fujita
Subject Re: postgres_fdw: oddity in costing aggregate pushdown paths
Date
Msg-id 5C2F449C.7010103@lab.ntt.co.jp
Whole thread Raw
In response to Re: postgres_fdw: oddity in costing aggregate pushdown paths  (Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>)
Responses Re: postgres_fdw: oddity in costing aggregate pushdown paths  (Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>)
List pgsql-hackers
(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

Attachment

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: don't create storage when unnecessary
Next
From: Magnus Hagander
Date:
Subject: Re: commit fest app: Authors