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 1h9A04-0008Gl-IV for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Mar 2019 14:57:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h9A02-0000HO-IO for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Mar 2019 14:57:54 +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 1h9A02-0000Dq-87 for pgsql-hackers@lists.postgresql.org; Wed, 27 Mar 2019 14:57:54 +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 1h99zz-0001DN-I7 for pgsql-hackers@postgresql.org; Wed, 27 Mar 2019 14:57:53 +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 x2REva0L018713; Wed, 27 Mar 2019 10:57:36 -0400 From: Tom Lane To: David Rowley cc: Amit Langote , 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: References: <9feacaf6-ddb3-96dd-5b98-df5e927b1439@lab.ntt.co.jp> <0F97FA9ABBDBE54F91744A9B37151A512B3279@g01jpexmbkw24> <0c90ce90-b010-4791-41c0-a0df34f99ffa@lab.ntt.co.jp> <0F97FA9ABBDBE54F91744A9B37151A512B3528@g01jpexmbkw24> <0F97FA9ABBDBE54F91744A9B37151A512B359C@g01jpexmbkw24> <72094fc9-3232-0fc7-b7cd-42e1c73d5aee@lab.ntt.co.jp> <0F97FA9ABBDBE54F91744A9B37151A512B45CD@g01jpexmbkw24> <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> Comments: In-reply-to David Rowley message dated "Wed, 27 Mar 2019 18:49:49 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <18711.1553698656.1@sss.pgh.pa.us> Date: Wed, 27 Mar 2019 10:57:36 -0400 Message-ID: <18712.1553698656@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk David Rowley writes: > On Wed, 27 Mar 2019 at 18:39, Amit Langote > wrote: >> On 2019/03/27 14:26, David Rowley wrote: >>> Perhaps the way to make this work, at least in the long term is to do >>> in the planner what we did in the executor in d73f4c74dd34. >> Maybe you meant 9ddef36278a9? > Probably. Yeah, there's something to be said for having plancat.c open each table *and store the Relation pointer in the RelOptInfo*, and then close that again at the end of planning rather than immediately. If we can't avoid these retail table_opens without a great deal of pain, that's the direction I'd tend to go in. However it would add some overhead, in the form of a need to traverse the RelOptInfo array an additional time. regards, tom lane