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 1ggR2G-0005Ib-Be for pgsql-hackers@arkaria.postgresql.org; Mon, 07 Jan 2019 09:17:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ggR2E-0006Zv-JG for pgsql-hackers@arkaria.postgresql.org; Mon, 07 Jan 2019 09:17:26 +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 1ggR2E-0006WX-Ag for pgsql-hackers@lists.postgresql.org; Mon, 07 Jan 2019 09:17:26 +0000 Received: from tama500.ecl.ntt.co.jp ([129.60.39.148]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ggR2C-0000Nm-2c for pgsql-hackers@postgresql.org; Mon, 07 Jan 2019 09:17:25 +0000 Received: from vc1.ecl.ntt.co.jp (vc1.ecl.ntt.co.jp [129.60.86.153]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id x079HJCB012743; Mon, 7 Jan 2019 18:17:19 +0900 Received: from vc1.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 87D88EA8929; Mon, 7 Jan 2019 18:17:19 +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 7D114EA8917; Mon, 7 Jan 2019 18:17:19 +0900 (JST) Received: from [127.0.0.1] (unknown [129.60.241.61]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id 772704007C7; Mon, 7 Jan 2019 18:17:19 +0900 (JST) Subject: Re: speeding up planning with partitions References: <3be67028-a00a-502c-199a-da00eec8fb6e@lab.ntt.co.jp> <73596f90-023c-c358-be9a-3c21bffcb15d@lab.ntt.co.jp> <0F97FA9ABBDBE54F91744A9B37151A5122E7B1@g01jpexmbkw24> <08a6775f-7c88-81a8-8c2c-984d171b6db9@lab.ntt.co.jp> <0F97FA9ABBDBE54F91744A9B37151A51232FF7@g01jpexmbkw24> <0F97FA9ABBDBE54F91744A9B37151A5124C0A0@g01jpexmbkw24> <580ddb99-cd31-096d-d485-fc309d274498@lab.ntt.co.jp> <55bd88c6-f311-2791-0a36-11c693c69753@lab.ntt.co.jp> <20190103153900.GA6236@telsasoft.com> From: Amit Langote Message-ID: Date: Mon, 7 Jan 2019 18:17:07 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CC-Mail-RelayStamp: 1 To: David Rowley , Justin Pryzby Cc: "Imai, Yoshikazu" , Alvaro Herrera , PostgreSQL-development X-TM-AS-MML: disable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thanks Justin for reporting the results of your testing. On 2019/01/07 17:40, David Rowley wrote: > On Fri, 4 Jan 2019 at 04:39, Justin Pryzby wrote: >> Running 11dev with your v10 patch applied, this takes 2244ms with empty buffer >> cache after postmaster restarted on a totally untuned instance (and a new >> backend, with no cached opened files). >> >> I was curious why it took even 2sec, and why it did so many opens() (but not >> 20k of them that PG11 does): > > It would be pretty hard to know that without seeing the query plan. Yeah, I too would be curious to see if the resulting plan really needs to do those open()s. If all the open()s being seen here are accounted for by un-pruned partitions (across the UNION ALL) contained in the plan and their indexes, then the patch has done enough to help. If the open()s can be traced to pruned partitions, then there's something wrong with the patch. Thanks, Amit