public inbox for [email protected]  
help / color / mirror / Atom feed
From: Andres Freund <[email protected]>
To: Sami Imseih <[email protected]>
Cc: Nathan Bossart <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: Alexander Lakhin <[email protected]>
Cc: Bharath Rupireddy <[email protected]>
Cc: Robert Treat <[email protected]>
Cc: [email protected]
Cc: pgsql-hackers <[email protected]>
Cc: [email protected]
Subject: Re: Add pg_stat_autovacuum_priority
Date: Thu, 9 Apr 2026 12:58:13 -0400
Message-ID: <bdwnlcqyctzjqxfgxqz3ge6mfpmxouxmlrykqzwghcqopfhsy6@wrkr25rmhkms> (raw)
In-Reply-To: <CAA5RZ0uiqzLPvZMXsooFPR5udpXUiVy8WvTLbduOvT2JPawYkA@mail.gmail.com>
References: <[email protected]>
	<adaWuTR7oCKodH7k@nathan>
	<[email protected]>
	<adan_E0o69p81lIj@nathan>
	<[email protected]>
	<u3akkfw3vaocviudt6f7ft4kxjc2273rh3tfhz5rfwg6jrcc2t@wurwws6wgjjz>
	<adbHYQMZ0pHQttWa@nathan>
	<CAA5RZ0uL1ukKvV0Gwgok9ut_203q_E_tzBrwhDAuJCKVNwWZVw@mail.gmail.com>
	<adbNL1puSbBi8nMo@nathan>
	<CAA5RZ0uiqzLPvZMXsooFPR5udpXUiVy8WvTLbduOvT2JPawYkA@mail.gmail.com>

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





view thread (60+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Add pg_stat_autovacuum_priority
  In-Reply-To: <bdwnlcqyctzjqxfgxqz3ge6mfpmxouxmlrykqzwghcqopfhsy6@wrkr25rmhkms>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox