Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1faWMb-0001Hv-MH for pgsql-committers@arkaria.postgresql.org; Wed, 04 Jul 2018 01:13:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1faWMX-0004M8-6z for pgsql-committers@arkaria.postgresql.org; Wed, 04 Jul 2018 01:13:41 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1faWMW-0004Lw-QN for pgsql-committers@lists.postgresql.org; Wed, 04 Jul 2018 01:13:40 +0000 Received: from tama500.ecl.ntt.co.jp ([129.60.39.148]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1faWMN-000887-LX for pgsql-committers@postgresql.org; Wed, 04 Jul 2018 01:13:37 +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 w641DHKJ010605; Wed, 4 Jul 2018 10:13:17 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 7C82B639951; Wed, 4 Jul 2018 10:13:17 +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 70B0763994F; Wed, 4 Jul 2018 10:13:17 +0900 (JST) Received: from [127.0.0.1] (unknown [129.60.241.61]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id 699F34001EA; Wed, 4 Jul 2018 10:13:17 +0900 (JST) Subject: Re: pgsql: Clarify use of temporary tables within partition trees References: <20180702221650.GA2159@paquier.xyz> <20180703045502.GA26236@paquier.xyz> <20180703061119.GA11732@paquier.xyz> <5db5fe6e-4a73-6a24-09e4-060b9f132ea9@lab.ntt.co.jp> <20180703070551.GC11732@paquier.xyz> <79177436-0b62-ee4f-2526-f58db4a45df0@lab.ntt.co.jp> From: Amit Langote Message-ID: Date: Wed, 4 Jul 2018 10:13:06 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 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: Ashutosh Bapat Cc: David Rowley , Michael Paquier , Robert Haas , pgsql-committers X-TM-AS-MML: disable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018/07/03 21:15, Ashutosh Bapat wrote: > On Tue, Jul 3, 2018 at 3:20 PM, Amit Langote > wrote: >> >> Maybe because that's what's done for the root parent in a plain >> inheritance hierarchy, which is always a plain table. In that case, one >> RTE is for its role as the parent (with rte->inh = true) and another is >> for its role as a child (with rte->inh = false). The former is processed >> as an append rel and the latter as a plain rel that will get assigned scan >> paths such as SeqScan, etc. > > Yes that's true. I remember we had some discussion about these two > RTEs and that the one marked as child was extraneous, but I can not > spot that in the mail thread. It's one of the things we did as part of > partition-wise join and that thread is pretty long. It was probably > kept without changing it because a. we wanted to get the bigger patch > committed without breaking anything and this was a small thing which > we couldn't decide whether was safe or not b. if it was safe not to > create that entry, it should have been done in a commit which avoided > creating scans for partitioned tables, but didn't About (b), maybe yes. Perhaps, I/we decided to put it off until we got around to writing a patch for making inheritance expansion step-wise for partitioned tables. We didn't get to that until 11dev branch opened up for development. The patch that I had proposed for step-wise expansion was such that the duplicate RTE for parents would not get created, but it wasn't committed. That was one of the things that was different from your patch for step-wise expansion which was committed. Thanks, Amit