public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tomas Vondra <[email protected]>
To: wenhui qiu <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: PoC: history of recent vacuum/checkpoint runs (using new hooks)
Date: Wed, 25 Dec 2024 18:25:50 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAGjGUAJSg3tJGxjeyU6T98ZYCXcAiGpq0eitAUQVaOa+nULDuA@mail.gmail.com>
References: <[email protected]>
<CAGjGUAJSg3tJGxjeyU6T98ZYCXcAiGpq0eitAUQVaOa+nULDuA@mail.gmail.com>
Hi,
On 12/23/24 07:35, wenhui qiu wrote:
> Hi Tomas
> This is a great feature.
> + /*
> + * Define (or redefine) custom GUC variables.
> + */
> + DefineCustomIntVariable("stats_history.size",
> + "Sets the amount of memory available for past events.",
> + NULL,
> + &statsHistorySizeMB,
> + 1,
> + 1,
> + 128,
> + PGC_POSTMASTER,
> + GUC_UNIT_MB,
> + NULL,
> + NULL,
> + NULL);
> +
> RAM is in terabytes now, the statsHistorySize is 128MB ,I think can
> increase to store more history record ?
>
Maybe, the 128MB is an arbitrary (and conservative) limit - it's enough
for ~500k events, which seems good enough for most systems. Of course,
on systems with many relations might need more space, not sure.
I was thinking about specifying the space in more natural terms, either
as amount of time ("keep 1 day of history") or number of entries ("10k
entries"). That would probably mean the memory can't be allocated as
fixed size.
But maybe it'd be possible to just write the entries to a file. We don't
need random access to past entries (unlike e.g. pg_stat_statements), and
people won't query that very often either.
regards
--
Tomas Vondra
view thread (7+ 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]
Subject: Re: PoC: history of recent vacuum/checkpoint runs (using new hooks)
In-Reply-To: <[email protected]>
* 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