public inbox for [email protected]
help / color / mirror / Atom feedFrom: Sami Imseih <[email protected]>
To: Bertrand Drouvot <[email protected]>
Cc: [email protected]
Subject: Re: Flush some statistics within running transactions
Date: Wed, 14 Jan 2026 21:54:17 -0600
Message-ID: <CAA5RZ0vgN8nf7yPrk_uNt-ABFtRnRuz7-9CM=qSzUSwj=EEUKw@mail.gmail.com> (raw)
In-Reply-To: <aWTVEycKj7Qh/[email protected]>
References: <aWTVEycKj7Qh/[email protected]>
Hi,
Thanks for these patches!
I took a quick look at the patches and I have some general comments.
> Long running transactions can accumulate significant statistics (WAL, IO, ...)
> that remain unflushed until the transaction ends. This delays visibility of
> resource usage in monitoring views like pg_stat_io and pg_stat_wal.
+1. I do think this is a good idea. Long-running transactions cause accumulated
stats to appear as spikes in monitoring tools rather than as gradual activity.
This would help level out, though not eliminate, those artificial spikes.
> The 1 second flush interval is currently hardcoded but we could imagine increase
> it or make it configurable.
Someone may want to turn this off as well. I think a GUC will be needed.
> RELATION stats are making use of FLUSH_MIXED:
> stats: numscans, tuples_returned, tuples_fetched, blocks_fetched,
> blocks_hit
I’m concerned that fields being temporarily out of sync might impact monitoring
calculations, if the formula is dealing with fields that have
different flush strategies.
That said, minor discrepancies are usually tolerable for monitoring
data analysis.
For the numscans, should we not also update the scan timestamp?
--
Sami Imseih
Amazon Web Services (AWS)
view thread (4+ 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]
Subject: Re: Flush some statistics within running transactions
In-Reply-To: <CAA5RZ0vgN8nf7yPrk_uNt-ABFtRnRuz7-9CM=qSzUSwj=EEUKw@mail.gmail.com>
* 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