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.96) (envelope-from ) id 1wAaNM-0006sL-1S for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Apr 2026 21:23:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wAaNK-002Dd6-2g for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Apr 2026 21:23:51 +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.96) (envelope-from ) id 1wAaNK-002Dcy-1p for pgsql-hackers@lists.postgresql.org; Wed, 08 Apr 2026 21:23:51 +0000 Received: from mail-oa1-x35.google.com ([2001:4860:4864:20::35]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wAaNJ-000000004L8-2RSw for pgsql-hackers@postgresql.org; Wed, 08 Apr 2026 21:23:51 +0000 Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-4042fe53946so122286fac.3 for ; Wed, 08 Apr 2026 14:23:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775683428; x=1776288228; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=4I2HGypCPe+cDTrFoI+PJZfevUfHWwNx0B6M9EjAjHA=; b=DYfF4xVa1qCOm5ycoLOZyCIjmk9PWvEl3/vEmkhWEQlPCfRV40zUDsWll8aomJHsWe TZXPj9ly56k7wD0I7Q7UxOTsFfkHoTLAi1sPRp76A5JIwkDd6fGFemxdPrxNuktXJV1g tmFP401IoUkomCq2T76H2FmI+fwbLdXTerTKeHC/cBjDOO/d/5c/OUDw+Y6GEQ84XarJ rXWxbItmAhX0lVJR/BGm0BYWbvWLjDqAS7TmUTxP1rQ40MzOhZ/Ifwvbd7GveSIX8Rxx aoc30UKkXq+Nj45jqPL73fAdvg4eB1qK1OyLPP628Jm9UAqWqxWQOrnUHYTZF4K94sc8 AG/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775683428; x=1776288228; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4I2HGypCPe+cDTrFoI+PJZfevUfHWwNx0B6M9EjAjHA=; b=YlAXGQOyCEVhDQfMVb0BVptTLyJAIagnhDBPP4svB9zyUQL1PmnvV9OoG6PP1cPDX6 w2ZPZnnkI6LAeAQEZgTEh/SN/dvzqR76fX0TK6Rw3G5kaIvQZgtVvMUa+WO05q4YdD6r wcHFZXm3bA6D5MJtwLINNKJegW53UV4GhIKouI9Bsbfl8MUWjzOC7AdA4WSmsOSddov4 ZKGnXk+pDe3jH2Q78ZLvi4G+GgWIQbec3CloA0O1RvYQtmRFCNeofVx9YA37OL/1j5yo J0xXEqiO+UvHsU3FrkZK8FXoqgi7MJ35/w2V4P/Y1YkH7qEf6+/AJe4KytxBOAdPVUA7 dxyA== X-Forwarded-Encrypted: i=1; AJvYcCU+Uj3zc19Xdr0yB2mIhzliV2kbcAb0+uGBHqWPLMGnXc0izadU+6h4YI5ShKE7U+YcAd+2yHnuiGGSaQa+@postgresql.org X-Gm-Message-State: AOJu0YxFqAoTABN0xAgkd6Ha8v7suglv7v9hkjYJ+qCLwdwnv3uoeovv OvKFtApfMAFFo7RHe05+u/IT/nhBb3JzKnN4njuGK15zRtJHtiHTBMIa X-Gm-Gg: AeBDies0e6PBU9vCZsvBysJLASnrSv8L6MR3BD3Q+Lb4M0yL3yzIiqD/eSHh8h5s6NT TbYQQgaoLzJKw6r1X9sEbKmE79qo4Qer+RdF68i916lBaP39B1DTargCt7vNlXki/8HcSPjgKmS ZJOFMtfws7ixwxNycPs4AX4Bmdql243iRQoqajFqUCxrJfb6Qi8JS0OuUqLwSOssAwQjBuUZkH1 0ZX3zAG6eP8QtNtBNHsIXCnWalFESHqwO9860BePHucQgzqbyF/0cAFiPDMDZNd81D3My6Dws0+ pYf7PrxS/ltHibwkpWoN6oBDgm2VduSzTyCRmR/LaRLMRkqw48ZerL83w9u/B37pAg9XuPL3bi/ kEGiG86E3r1VAZkM7qBzp1wxQ6WkwzRHqxmTNiwTCh5yF75SkRvkc7DkaFY0KHanyKUnMt7S4Hy PlGbxqeBYotVndrhvaAYtGST+pxlhGTE+ZoNckyBAYtRe7WeACgGS36iTMaprfbWLWO4DUKvCrq S7b1VVJC3Q3zHqMyihzMA== X-Received: by 2002:a05:6870:171a:b0:417:2a17:285 with SMTP id 586e51a60fabf-423bdbe7829mr597975fac.30.1775683427639; Wed, 08 Apr 2026 14:23:47 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-42330d4a3c1sm11668216fac.1.2026.04.08.14.23.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Apr 2026 14:23:47 -0700 (PDT) Date: Wed, 8 Apr 2026 16:23:45 -0500 From: Nathan Bossart To: Andres Freund Cc: Tom Lane , Alexander Lakhin , Sami Imseih , Bharath Rupireddy , Robert Treat , satyanarlapuram@gmail.com, pgsql-hackers , tndrwang@gmail.com Subject: Re: Add pg_stat_autovacuum_priority Message-ID: References: <5684f479-858e-4c5d-b8f5-bcf05de1f909@gmail.com> <3077290.1775668665@sss.pgh.pa.us> <3097984.1775674400@sss.pgh.pa.us> <3101163.1775676098@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Apr 08, 2026 at 04:40:03PM -0400, Andres Freund wrote: > Note that the whole cached state does automatically get reset at the end of > the transaction (AtEOXact_PgStat()->pgstat_clear_snapshot()), just like it did > before the shmem stats stuff. I see a lot of memory used for the pgStatEntryRefHash table, too (e.g., ~16 MB for 100K tables). What's interesting is that I cannot reproduce similar usage with views like pg_stat_all_tables. If memory was not a concern, I think the "bool *may_free" idea would be fine. But assuming it is, we will probably need to do something more creative. -- nathan