Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gU60Y-0000y1-7I for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Dec 2018 08:24:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gU60W-00028V-S7 for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Dec 2018 08:24:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gU60W-00028O-LF for pgsql-hackers@lists.postgresql.org; Tue, 04 Dec 2018 08:24:40 +0000 Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gU60S-0003Nz-6b for pgsql-hackers@postgresql.org; Tue, 04 Dec 2018 08:24:40 +0000 Received: from vc1.ecl.ntt.co.jp (vc1.ecl.ntt.co.jp [129.60.86.153]) by tama50.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id wB48OX5F029146 for ; Tue, 4 Dec 2018 17:24:33 +0900 Received: from vc1.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 36848EA80B3 for ; Tue, 4 Dec 2018 17:24:33 +0900 (JST) Received: from jcms-pop21.ecl.ntt.co.jp (jcms-pop21.ecl.ntt.co.jp [129.60.87.134]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 2C165EA7F5F for ; Tue, 4 Dec 2018 17:24:33 +0900 (JST) Received: from [IPv6:::1] (unknown [129.60.241.75]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id 28F7D400C2B for ; Tue, 4 Dec 2018 17:24:33 +0900 (JST) Message-ID: <5C0639B7.1080006@lab.ntt.co.jp> Date: Tue, 04 Dec 2018 17:24:23 +0900 From: Etsuro Fujita User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 Subject: Re: postgres_fdw: oddity in costing aggregate pushdown paths References: <5BFD3EAD.2060301@lab.ntt.co.jp> <5BFE1BDE.7010306@lab.ntt.co.jp> <5C010821.7050102@lab.ntt.co.jp> <5C051180.7090804@lab.ntt.co.jp> In-Reply-To: <5C051180.7090804@lab.ntt.co.jp> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-CC-Mail-RelayStamp: 1 To: Pg Hackers X-TM-AS-MML: disable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk (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, core does not care about costing HAVING expressions and >>> * adding that to the costs. So similarly, here too we are not >>> * considering remote and local conditions for costing. >>> >>> I think this was true when aggregate pushdown went in, but isn't anymore >>> because of commit 7b6c07547190f056b0464098bb5a2247129d7aa2. So we >>> should update estimate_path_cost_size so that it accounts for the >>> selectivity and cost of the HAVING expressions as well? >> >> There seems to be no objections, I updated the patch as such. Attached >> is an updated version of the patch. > > I revised some comments a bit and added the commit message. Attached is > an updated patch. If there are no objections, I'll apply this to HEAD only. Done after fixing typos in the commit message. Best regards, Etsuro Fujita