Re: Track IO times in pg_stat_io - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Track IO times in pg_stat_io
Date
Msg-id 20230307184751.jdokdy2xmx3xpaua@awork3.anarazel.de
Whole thread Raw
In response to Re: Track IO times in pg_stat_io  (Melanie Plageman <melanieplageman@gmail.com>)
Responses Re: Track IO times in pg_stat_io  ("Drouvot, Bertrand" <bertranddrouvot.pg@gmail.com>)
List pgsql-hackers
On 2023-03-07 13:43:28 -0500, Melanie Plageman wrote:
> > Now I've a second thought: what do you think about resetting the related number
> > of operations and *_time fields when enabling/disabling track_io_timing? (And mention it in the doc).
> >
> > That way it'd prevent bad interpretation (at least as far the time per operation metrics are concerned).
> >
> > Thinking that way as we'd loose some (most?) benefits of the new *_time columns
> > if one can't "trust" their related operations and/or one is not sampling pg_stat_io frequently enough (to discard
thesamples
 
> > where the track_io_timing changes occur).
> >
> > But well, resetting the operations could also lead to bad interpretation about the operations...
> >
> > Not sure about which approach I like the most yet, what do you think?
> 
> Oh, this is an interesting idea. I think you are right about the
> synchronization issues making the statistics untrustworthy and, thus,
> unuseable.

No, I don't think we can do that. It can be enabled on a per-session basis.

I think we simply shouldn't do anything here. This is a pre-existing issue. I
also think that loosing stats when turning track_io_timing on/off would not be
helpful.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Melanie Plageman
Date:
Subject: Re: Track IO times in pg_stat_io
Next
From: Robert Haas
Date:
Subject: Re: postgres_fdw, dblink, and CREATE SUBSCRIPTION security