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 1lK4SF-000764-LE for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Mar 2021 19:25:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lK4SE-0004ia-Jt for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Mar 2021 19:25:10 +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 1lK4SE-0004iS-DF for pgsql-hackers@lists.postgresql.org; Wed, 10 Mar 2021 19:25:10 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lK4SC-0008Pp-EN for pgsql-hackers@lists.postgresql.org; Wed, 10 Mar 2021 19:25:10 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 12AJOv8e2187989; Wed, 10 Mar 2021 14:24:57 -0500 From: Tom Lane To: Amit Langote cc: Kyotaro Horiguchi , keisuke kuroda , Alvaro Herrera , Tatsuro Yamada , PostgreSQL Hackers , tatsuhito.kasahara.rd@hco.ntt.co.jp Subject: Re: Huge memory consumption on partitioned table with FKs In-reply-to: References: <20201203.142857.1823750032495295791.horikyota.ntt@gmail.com> <20201204.144822.1258776940142794322.horikyota.ntt@gmail.com> <1412267.1614891636@sss.pgh.pa.us> <2050317.1615333064@sss.pgh.pa.us> Comments: In-reply-to Amit Langote message dated "Thu, 11 Mar 2021 00:44:53 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2187987.1615404297.1@sss.pgh.pa.us> Date: Wed, 10 Mar 2021 14:24:57 -0500 Message-ID: <2187988.1615404297@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Amit Langote writes: > On Wed, Mar 10, 2021 at 8:37 AM Tom Lane wrote: >> Hmm. So, the key point is that the values coming from the partitioned >> child table are injected into the test query as parameters, not as >> column references, thus it doesn't matter *to the test query* what >> numbers the referencing columns have in that child. We just have to >> be sure we pass the right parameter values. > Right. I did some cosmetic fooling with this (mostly, rewriting the comments YA time) and pushed it. regards, tom lane