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 1oWHsz-0000Gi-VW for pgsql-bugs@arkaria.postgresql.org; Thu, 08 Sep 2022 13:48:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oWHsy-0001m3-QQ for pgsql-bugs@arkaria.postgresql.org; Thu, 08 Sep 2022 13:48:04 +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 1oWHsy-0001lu-IC for pgsql-bugs@lists.postgresql.org; Thu, 08 Sep 2022 13:48:04 +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 1oWHsv-0004dl-RM for pgsql-bugs@lists.postgresql.org; Thu, 08 Sep 2022 13:48:03 +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 288DlvGP3950548; Thu, 8 Sep 2022 09:47:57 -0400 From: Tom Lane To: "James Pang (chaolpan)" cc: PostgreSQL mailing lists Subject: Re: huge memory of Postgresql backend process In-reply-to: References: Comments: In-reply-to "James Pang (chaolpan)" message dated "Thu, 08 Sep 2022 06:10:28 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3950546.1662644877.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 08 Sep 2022 09:47:57 -0400 Message-ID: <3950547.1662644877@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "James Pang (chaolpan)" writes: > We just switch from Oracle to PGV13, all of these tables got partition= (256 HASH partition) , when UPDATE/DELETE ... WHERE . The memory increas= e verify quickly until >130M. not too much data in these tables. When we = switch to PGV14.5 , test again, still see similar memory consumption issue= . I see no particular reason to think this is a bug. If you have a lot of partitions, there is going to be a lot of metadata for them. Moreover, HASH partitioning is effectively incapable of being pruned, so that every query is going to touch every partition. (IMO, hash partitioning is basically never a good idea.) regards, tom lane