Re: postgres_fdw: oddity in costing aggregate pushdown paths

From: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: postgres_fdw: oddity in costing aggregate pushdown paths
Date: 2019-01-04 11:33:48
Message-ID: 5C2F449C.7010103@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
fix-estimate_path_cost_size.patch text/x-patch 4.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2019-01-04 11:34:58 Re: commit fest app: Authors
Previous Message Peter Eisentraut 2019-01-04 11:33:06 Re: don't create storage when unnecessary