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 1ghuif-0006Hq-Bo for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Jan 2019 11:11:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ghuid-0003N4-Bu for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Jan 2019 11:11:19 +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 1ghuid-0003JY-2p for pgsql-hackers@lists.postgresql.org; Fri, 11 Jan 2019 11:11:19 +0000 Received: from tama500.ecl.ntt.co.jp ([129.60.39.148]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ghuia-0003Pq-SW for pgsql-hackers@postgresql.org; Fri, 11 Jan 2019 11:11:18 +0000 Received: from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id x0BBB9KO010429; Fri, 11 Jan 2019 20:11:09 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 2CED7638B79; Fri, 11 Jan 2019 20:11:09 +0900 (JST) Received: from jcms-pop21.ecl.ntt.co.jp (jcms-pop21.ecl.ntt.co.jp [129.60.87.134]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 211E0638B6B; Fri, 11 Jan 2019 20:11:09 +0900 (JST) Received: from [IPv6:::1] (unknown [129.60.241.75]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id 196BB400341; Fri, 11 Jan 2019 20:11:09 +0900 (JST) Message-ID: <5C3879B4.8000605@lab.ntt.co.jp> Date: Fri, 11 Jan 2019 20:10:44 +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: Query with high planning time at version 11.1 compared versions 10.5 and 11.0 References: <8db4eca8-6e76-70ff-f934-e0228a1cc298@lab.ntt.co.jp> <20181206075726.pig32e6thltb56hr@alvherre.pgsql> <5C34846E.9090600@lab.ntt.co.jp> <96720c99-ffa0-01ad-c594-0504c8eda708@lab.ntt.co.jp> <5C35D912.8040200@lab.ntt.co.jp> <7354b5bf-5932-4c0c-81ee-d9550de18995@lab.ntt.co.jp> <5C37FD8D.4080302@lab.ntt.co.jp> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CC-Mail-RelayStamp: 1 To: Amit Langote Cc: Amit Langote , Ashutosh Bapat , Alvaro Herrera , Justin Pryzby , sanyo.moura@tatic.net, Jeff Janes , David Rowley , Robert Haas , pgsql-hackers X-TM-AS-MML: disable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk (2019/01/11 13:49), Amit Langote wrote: > On 2019/01/11 11:21, Etsuro Fujita wrote: >> (2019/01/10 21:23), Amit Langote wrote: >>> On Thu, Jan 10, 2019 at 6:49 PM Ashutosh Bapat >>> wrote: >>>> Though this will solve a problem for performance when partition-wise >>>> join is not possible, we still have the same problem when >>>> partition-wise join is possible. And that problem really happens >>>> because our inheritance mechanism requires expression translation from >>>> parent to child everywhere. That consumes memory, eats CPU cycles and >>>> generally downgrades performance of partition related query planning. I >>>> think a better way would be to avoid these translations and use Parent >>>> var to represent a Var of the child being dealt with. That will be a >>>> massive churn on inheritance based planner code, but it will improve >>>> planning time for queries involving thousands of partitions. >>> >>> Yeah, it would be nice going forward to overhaul inheritance planning >>> such that parent-to-child Var translation is not needed, especially >>> where no pruning can occur or many partitions remain even after >>> pruning. >> >> I agree on that point, but I think that's an improvement for a future >> release rather than a fix for the issue reported on this thread. > > Agreed. Cool! > Improving planning performance for large number of partitions > even in the absence of pruning is a good goal to pursue for future > versions, as is being discussed in some other threads [1]. Yeah, we have a lot of challenges there. Thanks for sharing the info! Best regards, Etsuro Fujita