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 1kmHox-0006ub-If for pgsql-hackers@arkaria.postgresql.org; Mon, 07 Dec 2020 14:48:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kmHow-0002Oz-8Q for pgsql-hackers@arkaria.postgresql.org; Mon, 07 Dec 2020 14:48:58 +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 1kmHow-0002Os-1L for pgsql-hackers@lists.postgresql.org; Mon, 07 Dec 2020 14:48:58 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kmHot-0006ti-UA for pgsql-hackers@lists.postgresql.org; Mon, 07 Dec 2020 14:48:57 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id B0CF75C0110; Mon, 7 Dec 2020 09:48:54 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 07 Dec 2020 09:48:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=CPLXNEQvp2fdoB0xI N/qVkn0588LmbWHSCMLoBjiRds=; b=haW74qRnHEodo2nixe0IMVYmJZGTmuyNP u2Lv4Qb1/Ua5EneQpd3sNEc2ZdfK8ibdoI31ZMwcWYCAH7kA/bm7FrV3m10Dk+8X mdxqTZYUhrNieFiZzwhY0QKLdh9P33/r1zomOyetCBZfl7/RiXElqX0/PXvAfIrN L+uUAO0CNLBhnCKmCcLCLNmm8qQ9t6UI26Gtflxd5qdUkt6sVr1oL6TCB3er7dah srvKREiY/RsMY+/uulQB8yh6QFb5xqf5b40xRBprXRvbOA5qG4YVM+ssadUAYmpw wiliHWDyMg1lP5Ye2QGemg2jYs0oXGXwIR+HNwhSv8K+i36LTmrTg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudejgedgieekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggujggfsehttdertddtredvnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpeevgfelveegueejgefhgeetgefhgeehieefheehleetteei udeiiefhgffgheffteenucfkphepudeltddrleehrddukedrjeelnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhv hhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.18.79]) by mail.messagingengine.com (Postfix) with ESMTPA id DF119108005B; Mon, 7 Dec 2020 09:48:53 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id A0F272A0FAB; Mon, 7 Dec 2020 11:48:51 -0300 (-03) Date: Mon, 7 Dec 2020 11:48:51 -0300 From: Alvaro Herrera To: Amit Langote Cc: Kyotaro Horiguchi , keisuke kuroda , Tatsuro Yamada , PostgreSQL Hackers , tatsuhito.kasahara.rd@hco.ntt.co.jp Subject: Re: Huge memory consumption on partitioned table with FKs Message-ID: <20201207144851.GA15854@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Dec-07, Amit Langote wrote: > On Fri, Dec 4, 2020 at 12:05 PM Kyotaro Horiguchi > wrote: > > > Also, the comment that was in RI_ConstraintInfo now appears in > > > RI_ConstraintParam, and the new struct (RI_ConstraintInfo) is now > > > undocumented. What is the relationship between those two structs? I > > > see that they have pointers to each other, but I think the relationship > > > should be documented more clearly. > > > > I'm not sure the footprint of this patch worth doing but here is a bit > > more polished version. > > I noticed that the foreign_key test fails and it may have to do with > the fact that a partition's param info remains attached to the > parent's RI_ConstraintInfo even after it's detached from the parent > table using DETACH PARTITION. I think this bit about splitting the struct is a distraction. Let's get a patch that solves the bug first, and then we can discuss what further refinements we want to do. I think we should get your patch in CA+HiwqEOrfN9b=f3sDmySPGc4gO-L_VMFHXLLxVmmdP34e64+w@mail.gmail.com committed (which I have not read yet.) Do you agree with this plan?