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 1h9uPf-0004xf-16 for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Mar 2019 16:31:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h9uPd-0003MT-NB for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Mar 2019 16:31:25 +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 1h9uPd-0003Lt-E2 for pgsql-hackers@lists.postgresql.org; Fri, 29 Mar 2019 16:31:25 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h9uPa-00046g-MB for pgsql-hackers@postgresql.org; Fri, 29 Mar 2019 16:31:25 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x2TGV9ot019734; Fri, 29 Mar 2019 12:31:09 -0400 From: Tom Lane To: Amit Langote cc: David Rowley , Imai Yoshikazu , "jesper.pedersen@redhat.com" , "Imai, Yoshikazu" , Amit Langote , Alvaro Herrera , Robert Haas , Justin Pryzby , Pg Hackers Subject: Re: speeding up planning with partitions In-reply-to: <23831.1553873385@sss.pgh.pa.us> References: <53a80692-c68d-5e11-1014-6441b6e8ca5a@redhat.com> <20519.1553288822@sss.pgh.pa.us> <15573.1553639191@sss.pgh.pa.us> <47d2fd82-3f70-077b-abc6-863e3fa23503@lab.ntt.co.jp> <379243a6-33d5-af38-43c9-37120a0893bd@lab.ntt.co.jp> <18712.1553698656@sss.pgh.pa.us> <5! 9737210-61bd-e583-4393-cc0a5ab52549@lab.ntt.co.jp> <19663.1553749401@sss.pgh.pa.us> <2a531b7c-8ced-f868-2e! f2-5cf33b92ef0f@lab.ntt.co.jp> <23856.1553812684@sss.pgh.pa.us> <5c83dbca-12b5-1acf-0e85-58299e464a26@lab.ntt.co.jp> <23831.1553873385@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Fri, 29 Mar 2019 11:29:45 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19732.1553877069.1@sss.pgh.pa.us> Date: Fri, 29 Mar 2019 12:31:09 -0400 Message-ID: <19733.1553877069@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: > Amit Langote writes: >> About the XXX: I think resetting inh flag is unnecessary, so we should >> just remove the line. > Possibly. I hadn't had time to follow up the XXX annotation. Now I have ... Yeah, it seems we can just drop that and leave the flag alone. We'll end up running through set_append_rel_size and finding no relevant AppendRelInfos, but that's not going to take long enough to be a problem. It seems better to have the principle that rte->inh doesn't change after subquery_planner's initial scan of the rtable, so I'll make it so. >> If we do that, we can also get rid of the following >> code in set_rel_size(): No, we can't --- that's still reachable if somebody says "SELECT FROM ONLY partitioned_table". regards, tom lane