Re: [Patch] New pg_stat_tablespace view - Mailing list pgsql-hackers

From shihao zhong
Subject Re: [Patch] New pg_stat_tablespace view
Date
Msg-id CAGRkXqT0kE0cktzQALbzMrf_mHkfROPTJfCQvCYR02T9SAWt5A@mail.gmail.com
Whole thread
In response to Re: [Patch] New pg_stat_tablespace view  (Bernd Reiß <bd_reiss@gmx.at>)
Responses Re: [Patch] New pg_stat_tablespace view
Re: [Patch] New pg_stat_tablespace view
Re: [Patch] New pg_stat_tablespace view
List pgsql-hackers
Hi Bernd,

Thanks for testing.

> blks_read differs exactly by 3 and blks_hit by 7

I can reproduce this, and it does not need a restart. pg_stat_reset()
clears the database entry and pg_stat_reset_shared() clears the tablespace
entry. If more than a second passes between them, the backend flushes its
pending counts in the gap, and the entry that was reset first keeps them.
Swapping the two resets flips the sign. With both resets in one statement
the numbers always match.

> there is some skew in blk_read_time and blk_write_time

Part of it was the second clock read. v7 reuses the time that
pgstat_count_io_op_time() already computed.


> one test still checks for >= 0

Fixed.

v7 attached.

Thanks,
Shihao 



Attachment

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: PG 19 status blog report
Next
From: Kirill Reshke
Date:
Subject: Re: Wrong results from join removal with DISTINCT ON + SRF subquery