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 1sbhvb-000qmh-Qu for pgsql-bugs@arkaria.postgresql.org; Wed, 07 Aug 2024 14:46:15 +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 1sbhvY-007vos-Jw for pgsql-bugs@arkaria.postgresql.org; Wed, 07 Aug 2024 14:46:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sbhvY-007voh-BA for pgsql-bugs@lists.postgresql.org; Wed, 07 Aug 2024 14:46:12 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sbhvV-003e8r-Qk for pgsql-bugs@lists.postgresql.org; Wed, 07 Aug 2024 14:46: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 477Ek6jx1959773; Wed, 7 Aug 2024 10:46:06 -0400 From: Tom Lane To: zeleny.ales@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18573: Analyze command consumes several GB of memory - more than analyzed table size In-reply-to: <18573-4bd97c0c25e99339@postgresql.org> References: <18573-4bd97c0c25e99339@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Tue, 06 Aug 2024 23:22:22 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1959771.1723041966.1@sss.pgh.pa.us> Date: Wed, 07 Aug 2024 10:46:06 -0400 Message-ID: <1959772.1723041966@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > Is there more I can do to identify why analyze uses that much memory? What have you got default_statistics_target set to? You might need to decrease the stats target for that composite-array column. compute_array_stats is fairly aggressive about how much data it will try to collect, and I can believe that that'd add up when the array elements are of a wide composite type. regards, tom lane