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 1wAshy-000VyS-1a for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Apr 2026 16:58:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wAshv-006kH3-2L for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Apr 2026 16:58:20 +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 1wAshv-006kGv-1O for pgsql-hackers@lists.postgresql.org; Thu, 09 Apr 2026 16:58:20 +0000 Received: from fhigh-b5-smtp.messagingengine.com ([202.12.124.156]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wAsht-00000000DGK-3w5q for pgsql-hackers@postgresql.org; Thu, 09 Apr 2026 16:58:19 +0000 Received: from phl-compute-07.internal (phl-compute-07.internal [10.202.2.47]) by mailfhigh.stl.internal (Postfix) with ESMTP id A8D937A00EB; Thu, 9 Apr 2026 12:58:14 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-07.internal (MEProxy); Thu, 09 Apr 2026 12:58:15 -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=1775753894; x=1775840294; bh=sSHIvtreFB zsMjWXaldHXnObw4GGQR0zUdXgtGAmzHU=; b=AUHVZx5feyNnGd+dlDVFKm+Sz+ O3mABgrjOarxe7wMDeOJq1bPmZq8gTZTimPGuhgaXMdzheKdNytNG3DFKy1CsK43 6aY76zXs30NnKxJpNu2apCoWk/QfJIXDv9HHMK9gKcAmSv8qIlHFSJQY66+x2Ldc nn0Li5KQDI5jP4jrAbTCNnEsWGIx1ey4POQIItSRk9syE5HLUAFOcrKpQr5lOIGg LqpQKTCODtkH+9NyEalqxhH1OjOhZamMEOhKFuS3nZRVMMxIlqORN9s1fBvo6OFm 84YVWJp7UrFUbh3tKby3KFAClWjE/3wmqE9Lt2yOvXVPd6B7RvMSo0Zkx/6A== 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= 1775753894; x=1775840294; bh=sSHIvtreFBzsMjWXaldHXnObw4GGQR0zUdX gtGAmzHU=; b=kxFc+ypwbRQ4qYdWRJEiwXlm6dzHKpmqByj9X78DB5OVY1UDHaD 7Cll1EiMSfFiGDdR2rI6gZVDeL3gVqQjtHSt+NC1SU0gN5JKz/dNSE2ipXsITl52 40eVUsifCNDyFGk5UCMi4E/PIryw9leeL3SlEbw5nU124UIwpUseYCPTufN+33fi ceWxOVasWzqF2bREOYnL9BQ+aFHZzk3DAaZL9noxr4yd3lSXhEUxdU1RaW50M05z ns+T8bgJ0KixJUShvQisL6Rh5aVWiEcROJSSkQ40CFhUJSP0+YKQ9XJr6eeviX30 NB2ttL5VARwjEcJpHpXivZx5TVC7nNt6tbg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgddvjedtfecutefuodetggdotefrod 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; Thu, 9 Apr 2026 12:58:14 -0400 (EDT) Date: Thu, 9 Apr 2026 12:58:13 -0400 From: Andres Freund To: Sami Imseih Cc: Nathan Bossart , Tom Lane , Alexander Lakhin , Bharath Rupireddy , Robert Treat , satyanarlapuram@gmail.com, pgsql-hackers , tndrwang@gmail.com Subject: Re: Add pg_stat_autovacuum_priority Message-ID: References: <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 Hi, On 2026-04-08 18:51:59 -0500, Sami Imseih wrote: > There may be some opportunities to improve other call sites if they > are indeed leaking. > For example, pgstat_copy_relation_stats() could leak with > fetch_consistency = NONE. Hard to believe that could be relevant, given it's used when reindexing concurrently. Compared to the amount of memory that will use, leaving a small bit of memory around until the end of the statement is likely hard to even measure. > I kept that out for now, but we should probably close that gap in another > patch. Also, pgstat_fetch_stat_dbentry() in autovacuum.c could potentially > use this, but I did not look into detail. Probably fine, it's a temporary context that's just used for building the list. You'd have to have a lot of databases for this to be a relevant factor. The whole function fundamentally uses O(databases) memory, making the constant factor a bit bigger doesn't seem reelvant. Greetings, Andres Freund