Re: postgres_fdw: oddity in costing aggregate pushdown paths

2019-01-23 Thread Etsuro Fujita
(2019/01/23 20:35), Etsuro Fujita wrote: > Attached is an updated version of the patch. > > Changes: > * Fixed a stupid bug in the case when use_remote_estimate > * Fixed a typo in a comment I added > * Modified comments I added a little bit further > * Added the commit message > > If there are n

Re: postgres_fdw: oddity in costing aggregate pushdown paths

2019-01-23 Thread Etsuro Fujita
(2019/01/04 20:33), Etsuro Fujita wrote: > Here is a new version of the patch. Attached is an updated version of the patch. Changes: * Fixed a stupid bug in the case when use_remote_estimate * Fixed a typo in a comment I added * Modified comments I added a little bit further * Added the commit me

Re: postgres_fdw: oddity in costing aggregate pushdown paths

2019-01-04 Thread Etsuro Fujita
(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

Re: postgres_fdw: oddity in costing aggregate pushdown paths

2018-12-28 Thread Etsuro Fujita
(2018/12/04 17:24), Etsuro Fujita wrote: > (2018/12/03 20:20), Etsuro Fujita wrote: >> (2018/11/30 18:51), Etsuro Fujita wrote: >>> (2018/11/28 13:38), Etsuro Fujita wrote: BTW another thing I noticed is this comment on costing aggregate pushdown paths using local statistics in estimate_p

Re: postgres_fdw: oddity in costing aggregate pushdown paths

2018-12-04 Thread Etsuro Fujita
(2018/12/03 20:20), Etsuro Fujita wrote: > (2018/11/30 18:51), Etsuro Fujita wrote: >> (2018/11/28 13:38), Etsuro Fujita wrote: >>> BTW another thing I noticed is this comment on costing aggregate >>> pushdown paths using local statistics in estimate_path_cost_size: >>> >>> * Also,

Re: postgres_fdw: oddity in costing aggregate pushdown paths

2018-12-03 Thread Etsuro Fujita
(2018/11/30 18:51), Etsuro Fujita wrote: > (2018/11/28 13:38), Etsuro Fujita wrote: >> BTW another thing I noticed is this comment on costing aggregate >> pushdown paths using local statistics in estimate_path_cost_size: >> >>* Also, core does not care about costing HAVING expressio

Re: postgres_fdw: oddity in costing aggregate pushdown paths

2018-11-30 Thread Etsuro Fujita
(2018/11/28 13:38), Etsuro Fujita wrote: > BTW another thing I noticed is this comment on costing aggregate > pushdown paths using local statistics in estimate_path_cost_size: > > * Also, core does not care about costing HAVING expressions and > * adding that to the cos

Re: postgres_fdw: oddity in costing aggregate pushdown paths

2018-11-27 Thread Etsuro Fujita
(2018/11/27 21:55), Etsuro Fujita wrote: > While working on [1], I noticed that since we don't set the selectivity > and cost of the local_conds (i.e., fpinfo->local_conds_sel and > fpinfo->local_conds_cost) properly in add_foreign_grouping_paths and > foreign_grouping_ok, estimate_path_cost_size p

postgres_fdw: oddity in costing aggregate pushdown paths

2018-11-27 Thread Etsuro Fujita
Hi, While working on [1], I noticed that since we don't set the selectivity and cost of the local_conds (i.e., fpinfo->local_conds_sel and fpinfo->local_conds_cost) properly in add_foreign_grouping_paths and foreign_grouping_ok, estimate_path_cost_size produces considerably underestimated results