Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p12q1-0002XT-E2 for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Dec 2022 10:00:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p12q0-0000jb-AO for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Dec 2022 10:00:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p12pz-0000gh-5n for pgsql-hackers@lists.postgresql.org; Fri, 02 Dec 2022 10:00:08 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p12pw-00073E-4G for pgsql-hackers@lists.postgresql.org; Fri, 02 Dec 2022 10:00:06 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 724F2320027A; Fri, 2 Dec 2022 05:00:00 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 02 Dec 2022 05:00:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1669975199; x=1670061599; bh=y xUVulWuxegdw28ZdcR6jz2kU7++t3uy4QXahV0A9WE=; b=rWxNgQcHRZPpZzPcj BRatT8jSU1BNKzwbiJwACgDVBXV3xObMfR6SuXv5/8qwOJZK0vcGuTMf+SnJ0kQN YtG7jFyoAqzu16IMu1r4BMKINSSvsaxUm5GXjRlGcjVliJDzRz3+stTxpgpCDlhi I4Z3Z0WeBJVxNU6vSxsKWUvaxF/54uxMtRo+ms+vFOBkXXefQ6inHncuZ6ELLFna ijKL9wiUa8IkaKAY4H2VYwkD6TT0E6efKSmfbwxhi6V50o0ftwT6fSGE3Q2U8hsx gjVB+auZaA8szPZMBSjC31x6+CCQs0nIIbubn5WqAuvKMAJhGxIndBu9q7YE0s5h j2ngA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrtdejgdduudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpedvkedtffduffdtffffheffhfejjefhgfeiueeukeejkeff gfdufffhudffffeuveenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhh vghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 2 Dec 2022 04:59:59 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 8B56FE98; Fri, 2 Dec 2022 10:59:54 +0100 (CET) Date: Fri, 2 Dec 2022 10:59:54 +0100 From: Alvaro Herrera To: Amit Langote Cc: Ian Lawrence Barwick , Tom Lane , David Rowley , Greg Stark , Julien Rouhaud , PostgreSQL Hackers Subject: Re: ExecRTCheckPerms() and many prunable partitions Message-ID: <20221202095954.2egmwmoj7efp4gwp@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, On 2022-Dec-02, Amit Langote wrote: > This sounds like a better idea than adding a new AttrMap, so done this > way in the attached 0001. Thanks for doing that! I have pushed it, but I renamed ri_RootToPartitionMap to ri_RootToChildMap and moved it to another spot in ResultRelInfo, which allows to simplify the comments. > I've also merged into 0002 the delta patch I had posted earlier to add > a copy of RTEPermInfos into the flattened permInfos list instead of > adding the Query's copy. Great. At this point I have no other comments, except that in both parse_relation.c and rewriteManip.c you've chosen to add the new functions at the bottom of each file, which is seldom a good choice. I think in the case of CombineRangeTables it should be the very first function in the file, before all the walker-type stuff; and for Add/GetRTEPermissionInfo I would suggest that right below addRangeTableEntryForENR might be a decent choice (need to fix the .h files to match, of course.) -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "World domination is proceeding according to plan" (Andrew Morton)