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 1gkTjH-0006N5-PA for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Jan 2019 12:58:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gkTjE-0004hl-KT for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Jan 2019 12:58:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gkTjE-0004he-4L for pgsql-hackers@lists.postgresql.org; Fri, 18 Jan 2019 12:58:32 +0000 Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gkTj6-0005II-1N for pgsql-hackers@postgresql.org; Fri, 18 Jan 2019 12:58:30 +0000 Received: from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154]) by tama50.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id x0ICwJ7o015597; Fri, 18 Jan 2019 21:58:19 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 3FD946393AF; Fri, 18 Jan 2019 21:58:19 +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 342EB6393A4; Fri, 18 Jan 2019 21:58:19 +0900 (JST) Received: from [IPv6:::1] (unknown [129.60.241.75]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id 2995B400D1A; Fri, 18 Jan 2019 21:58:19 +0900 (JST) Message-ID: <5C41CCC0.5030702@lab.ntt.co.jp> Date: Fri, 18 Jan 2019 21:55:28 +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> <5C36E105.2020902@lab.ntt.co.jp> <5C38910B.8010901@lab.ntt.co.jp> <5C3EC4EC.5070404@lab.ntt.co.jp> In-Reply-To: <5C3EC4EC.5070404@lab.ntt.co.jp> Content-Type: multipart/mixed; boundary="------------070705030501070105080003" X-CC-Mail-RelayStamp: 1 To: Amit Langote Cc: Ashutosh Bapat , alvherre@2ndquadrant.com, pryzby@telsasoft.com, sanyo.moura@tatic.net, Jeff Janes , david.rowley@2ndquadrant.com, Robert Haas , pgsql-hackers@postgresql.org X-TM-AS-MML: disable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------070705030501070105080003 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit (2019/01/16 14:45), Etsuro Fujita wrote: > (2019/01/15 11:42), Amit Langote wrote: >> On 2019/01/11 21:50, Etsuro Fujita wrote: >>>>> (2019/01/10 10:41), Amit Langote wrote: >>>>>> That's a loaded meaning and abusing it to mean something else can be >>>>>> challenged, but we can live with that if properly documented. >>>>>> Speaking of >>>>>> which: >>>>>> >>>>>> /* used by partitionwise joins: */ >>>>>> bool consider_partitionwise_join; /* consider >>>>>> partitionwise join >>>>>> * paths? (if >>>>>> partitioned >>>>>> rel) */ >>>>>> >>>>>> Maybe, mention here how it will be abused in back-branches for >>>>>> non-partitioned relations? > >>> I know we don't yet reach a consensus on what to do in details to >>> address >>> this issue, but for the above, how about adding comments like this to >>> set_append_rel_size(), instead of the header file: >>> >>> /* >>> * If we consider partitionwise joins with the parent rel, do the >>> same >>> * for partitioned child rels. >>> * >>> * Note: here we abuse the consider_partitionwise_join flag for child >>> * rels that are not partitioned, to tell try_partitionwise_join() >>> * that their targetlists and EC entries have been generated. >>> */ >>> if (rel->consider_partitionwise_join) >>> childrel->consider_partitionwise_join = true; >>> >>> ISTM that that would be more clearer than the header file. >> >> Thanks for updating the patch. I tend to agree that it might be better to >> add such details here than in the header as it's better to keep the >> latter >> more stable. >> >> About the comment you added, I think we could clarify the note further >> as: >> >> Note: here we abuse the consider_partitionwise_join flag by setting it >> *even* for child rels that are not partitioned. In that case, we set it >> to tell try_partitionwise_join() that it doesn't need to generate their >> targetlists and EC entries as they have already been generated here, as >> opposed to the dummy child rels for which the flag is left set to >> false so >> that it will generate them. >> >> Maybe it's a bit wordy, but it helps get the intention across more >> clearly. > > I think that is well-worded, so +1 from me. I updated the patch as such and rebased it to the latest HEAD. I also added the commit message. Attached is an updated patch. Does that make sense? If there are no objections, I'll push that patch early next week. Best regards, Etsuro Fujita --------------070705030501070105080003 Content-Type: text/x-patch; name="0001-Postpone-generating-tlists-and-EC-members-for-inheri.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-Postpone-generating-tlists-and-EC-members-for-inheri.pa"; filename*1="tch"