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 1wAZh5-0006RL-25 for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Apr 2026 20:40:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wAZh2-001zDr-1p for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Apr 2026 20:40:09 +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.96) (envelope-from ) id 1wAZh2-001zDi-0t for pgsql-hackers@lists.postgresql.org; Wed, 08 Apr 2026 20:40:09 +0000 Received: from fhigh-a3-smtp.messagingengine.com ([103.168.172.154]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wAZh1-000000003GK-0GFM for pgsql-hackers@postgresql.org; Wed, 08 Apr 2026 20:40:08 +0000 Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfhigh.phl.internal (Postfix) with ESMTP id 11EA11400266; Wed, 8 Apr 2026 16:40:06 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Wed, 08 Apr 2026 16:40:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1775680806; x=1775767206; bh=JquhYRozOz +621mvkVFVypbQ+soCM7M/liLfo0hJCDY=; b=PczfvkAMNbJdi+EzYao9Ic9oBk HaNVzewWdM0JA7BSfkMnaydh1iS6NaAdByctKxkv83QuxAhGXxnibMsymfaMuvrK jYGlAPnOd7mLSDwljsQ1S7mvPvYyrDKs8zuE2oYx+NWdmvPKd2ecTB7t+srODK+3 FoftoQaV0ha51xvDVBIl/4apgZqHaIMbv9p36uacEVkq8FxGL7DKSiVgBObDbQ3A lIX9R/8Br1nuo1f0macyJhw6M8g8jNH7zzRJGi06UVP8E1viw1RsDPujwEgCWTPs v/Yzq3q3vWj8P3sdRsa1CZb7bgXOWRcylAGFkxx+w/AGu4ZUzRp/zJeIoQzg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1775680806; x=1775767206; bh=JquhYRozOz+621mvkVFVypbQ+soCM7M/liL fo0hJCDY=; b=pQCSYA18GAdHdcC5RCP/2Ub/PV0z0nA4LkHkhHskMNzlKxnlRIb VoS4pnbxZqNi7o8/i6wrjdJNNns+WWzAudd2v36QJEX3sOyRdr/999olp1Cp/fKl 20/MhaBH4Uqf4IzvkXJ3zEFaZmZIDd/GjcVFTAlOEMEDwSOPQyL74gnSfboXNb9v goid0n/26VcITISFWe563Pa7QLarLMaQdl9NbJStpza18QDkEZraA8/H6nD/v029 5IY8d8tXjpoxkmaacoW8ZxXveSbcbhBcorHZiDCHmD1e7+Ea3Uuwm+CnhT+fcaxm FsZnfHXeuFA2Zzj1mwX1MFxoYRcoQTWpiIA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgddvgeehhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfhfgggtuggjsehttdfstddttddvnecuhfhrohhmpeetnhgurhgvshcu hfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtffrrghtth gvrhhnpeeffffgledvffegtdevlefgtdeggffhvdekgfegteeiveejkeetudelveejhfeu geenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnh gurhgvshesrghnrghrrgiivghlrdguvgdpnhgspghrtghpthhtohepledpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtohepsghhrghrrghthhdrrhhuphhirhgvugguhihfohhrph hoshhtghhrvghssehgmhgrihhlrdgtohhmpdhrtghpthhtohepvgigtghluhhsihhonhes ghhmrghilhdrtghomhdprhgtphhtthhopehnrghthhgrnhgusghoshhsrghrthesghhmrg hilhdrtghomhdprhgtphhtthhopehsrghmihhmshgvihhhsehgmhgrihhlrdgtohhmpdhr tghpthhtohepshgrthihrghnrghrlhgrphhurhgrmhesghhmrghilhdrtghomhdprhgtph htthhopehtnhgurhifrghnghesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhl qdhhrggtkhgvrhhssehpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopehtghhlse hsshhsrdhpghhhrdhprgdruhhspdhrtghpthhtoheprhhosgesgiiiihhllhgrrdhnvght X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 8 Apr 2026 16:40:05 -0400 (EDT) Date: Wed, 8 Apr 2026 16:40:03 -0400 From: Andres Freund To: Tom Lane Cc: Nathan Bossart , 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: <3101163.1775676098@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2026-04-08 15:21:38 -0400, Tom Lane wrote: > Hmm, yeah I suppose a caller that doesn't care about leakage could > skip the pfree. But are there really any of those? The complaint > that prompted 02502c1bc concerned databases with many many thousands > of relations. Most of the calls come from SQL callable functions that just return a value to the user. For those I don't think we gain anything by doing retail pfrees, if anything it'd hurt performance. > I now realize that what you said upthread about caching the results > might be a bigger problem, ie if the pgstats code does retain all > these values then we'd have a memory bloat problem there. Maybe > we need a more aggressive API change that includes a way to specify > "don't cache this result". I can't stop myself from pointing out that the whole reason this caching stuff exists is because you insistet that we provide an equivalent for snapshotting semantics of the pre-shmem stats system... 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. Greetings, Andres Freund