Re: Track IO times in pg_stat_io

2023-04-07 Thread Andres Freund
Hi, On 2023-04-07 12:17:38 -0400, Melanie Plageman wrote: > Attached v9 addresses review feedback as well as resolving merge > conflicts with recent relation extension patchset. I've edited it a bit more: - removed pgstat_tracks_io_time() and replaced it by returning the new IO_COL_INVALID =

Re: Track IO times in pg_stat_io

2023-04-07 Thread Melanie Plageman
Attached v9 addresses review feedback as well as resolving merge conflicts with recent relation extension patchset. I've changed pgstat_count_io_op_time() to take a count and call pgstat_count_io_op_n() so it can be used with smgrzeroextend(). I do wish that the parameter to

Re: Track IO times in pg_stat_io

2023-04-04 Thread Andres Freund
Hi, On 2023-03-31 15:44:58 -0400, Melanie Plageman wrote: > From 789d4bf1fb749a26523dbcd2c69795916b711c68 Mon Sep 17 00:00:00 2001 > From: Melanie Plageman > Date: Tue, 21 Mar 2023 16:00:55 -0400 > Subject: [PATCH v8 1/4] Count IO time for temp relation writes > > Both pgstat_database and

Re: Track IO times in pg_stat_io

2023-03-31 Thread Melanie Plageman
Attached is a rebased version in light of 8aaa04b32d - Melanie From 789d4bf1fb749a26523dbcd2c69795916b711c68 Mon Sep 17 00:00:00 2001 From: Melanie Plageman Date: Tue, 21 Mar 2023 16:00:55 -0400 Subject: [PATCH v8 1/4] Count IO time for temp relation writes Both pgstat_database and

Re: Track IO times in pg_stat_io

2023-03-21 Thread Melanie Plageman
On Mon, Mar 20, 2023 at 10:34 PM Andres Freund wrote: > > Hi, > > On 2023-03-16 17:19:16 -0400, Melanie Plageman wrote: > > > > > I wonder if we should get rid of pgStatBlockReadTime, > > > > > pgStatBlockWriteTime, > > > > > > > > And then have pg_stat_reset_shared('io') reset pg_stat_database

Re: Track IO times in pg_stat_io

2023-03-20 Thread Andres Freund
Hi, On 2023-03-16 17:19:16 -0400, Melanie Plageman wrote: > > > > I wonder if we should get rid of pgStatBlockReadTime, > > > > pgStatBlockWriteTime, > > > > > > And then have pg_stat_reset_shared('io') reset pg_stat_database IO > > > stats? > > > > Yes. > > I think this makes sense but I am

Re: Track IO times in pg_stat_io

2023-03-16 Thread Melanie Plageman
v5 attached mostly addresses instr_time persistence issues. On Tue, Mar 14, 2023 at 6:56 PM Andres Freund wrote: > On 2023-03-09 11:50:38 -0500, Melanie Plageman wrote: > > On Tue, Mar 7, 2023 at 1:39 PM Andres Freund wrote: > > > On 2023-03-06 11:30:13 -0500, Melanie Plageman wrote: > > > > >

Re: Track IO times in pg_stat_io

2023-03-14 Thread Andres Freund
Hi, On 2023-03-09 11:50:38 -0500, Melanie Plageman wrote: > On Tue, Mar 7, 2023 at 1:39 PM Andres Freund wrote: > > On 2023-03-06 11:30:13 -0500, Melanie Plageman wrote: > > > > As pgstat_bktype_io_stats_valid() is called only in Assert(), I think > > > > that would be a good idea > > > > to

Re: Track IO times in pg_stat_io

2023-03-09 Thread Melanie Plageman
Hi, v4 attached addresses these review comments. On Tue, Mar 7, 2023 at 1:39 PM Andres Freund wrote: > On 2023-03-06 11:30:13 -0500, Melanie Plageman wrote: > > > As pgstat_bktype_io_stats_valid() is called only in Assert(), I think > > > that would be a good idea > > > to also check that if

Re: Track IO times in pg_stat_io

2023-03-09 Thread Imseih (AWS), Sami
> >>> 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 > >>>

Re: Track IO times in pg_stat_io

2023-03-09 Thread Drouvot, Bertrand
Hi, On 3/9/23 1:34 AM, Andres Freund wrote: Hi, On 2023-03-08 12:55:34 +0100, Drouvot, Bertrand wrote: On 3/7/23 7:47 PM, Andres Freund wrote: On 2023-03-07 13:43:28 -0500, Melanie Plageman wrote: No, I don't think we can do that. It can be enabled on a per-session basis. Oh right. So it's

Re: Track IO times in pg_stat_io

2023-03-08 Thread Andres Freund
Hi, On 2023-03-08 12:55:34 +0100, Drouvot, Bertrand wrote: > On 3/7/23 7:47 PM, Andres Freund wrote: > > 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

Re: Track IO times in pg_stat_io

2023-03-08 Thread Drouvot, Bertrand
Hi, On 3/7/23 7:47 PM, Andres Freund wrote: 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

Re: Track IO times in pg_stat_io

2023-03-07 Thread Andres Freund
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

Re: Track IO times in pg_stat_io

2023-03-07 Thread Melanie Plageman
Thanks for taking another look! On Tue, Mar 7, 2023 at 10:52 AM Drouvot, Bertrand wrote: > On 3/6/23 5:30 PM, Melanie Plageman wrote: > > Thanks for the review! > > > > On Tue, Feb 28, 2023 at 4:49 AM Drouvot, Bertrand > > wrote: > >> On 2/26/23 5:03 PM, Melanie Plageman wrote: > >>> The

Re: Track IO times in pg_stat_io

2023-03-07 Thread Andres Freund
Hi, On 2023-03-06 11:30:13 -0500, Melanie Plageman wrote: > > As pgstat_bktype_io_stats_valid() is called only in Assert(), I think that > > would be a good idea > > to also check that if counts are not Zero then times are not Zero. > > Yes, I think adding some validation around the

Re: Track IO times in pg_stat_io

2023-03-07 Thread Drouvot, Bertrand
Hi, On 3/6/23 5:30 PM, Melanie Plageman wrote: Thanks for the review! On Tue, Feb 28, 2023 at 4:49 AM Drouvot, Bertrand wrote: On 2/26/23 5:03 PM, Melanie Plageman wrote: The timings will only be non-zero when track_io_timing is on That could lead to incorrect interpretation if one wants

Re: Track IO times in pg_stat_io

2023-03-06 Thread Melanie Plageman
Thanks for the review! On Tue, Feb 28, 2023 at 4:49 AM Drouvot, Bertrand wrote: > On 2/26/23 5:03 PM, Melanie Plageman wrote: > > As suggested in [1], the attached patch adds IO times to pg_stat_io; > > Thanks for the patch! > > I started to have a look at it and figured out that a tiny rebase

Re: Track IO times in pg_stat_io

2023-02-28 Thread Drouvot, Bertrand
Hi, On 2/26/23 5:03 PM, Melanie Plageman wrote: Hi, As suggested in [1], the attached patch adds IO times to pg_stat_io; Thanks for the patch! I started to have a look at it and figured out that a tiny rebase was needed (due to 728560db7d and b9f0e54bc9), so please find the rebase (aka V2)