Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uohcv-008ZrM-Ei for pgsql-bugs@arkaria.postgresql.org; Wed, 20 Aug 2025 12:09:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uohcu-007zc2-GV for pgsql-bugs@arkaria.postgresql.org; Wed, 20 Aug 2025 12:09:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uohcu-007zbs-8a for pgsql-bugs@lists.postgresql.org; Wed, 20 Aug 2025 12:09:12 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uohcs-000qDB-1c for pgsql-bugs@lists.postgresql.org; Wed, 20 Aug 2025 12:09:11 +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 57KC9AEn989439; Wed, 20 Aug 2025 08:09:10 -0400 From: Tom Lane To: Zhu Yang cc: "pgsql-bugs@lists.postgresql.org" Subject: Re: The memory usage is positively correlated with the number of partition tables when pg_get_expr is called. In-reply-to: References: Comments: In-reply-to Zhu Yang message dated "Wed, 20 Aug 2025 06:16:53 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <989437.1755691750.1@sss.pgh.pa.us> Date: Wed, 20 Aug 2025 08:09:10 -0400 Message-ID: <989438.1755691750@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Zhu Yang writes: > Unreasonable memory usage. Not at all. You have a session that has accessed 100000 tables. If you don't want to eat a lot of relcache space, rethink your schema. (IMV, a table with hundreds or thousands of partitions is an anti-pattern.) regards, tom lane