Re: Calculating average block write time

From: Ron <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Calculating average block write time
Date: 2022-11-18 16:14:38
Message-ID: 7d88dffa-b1ca-062f-8ff4-806f6c3a5578@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/18/22 09:51, Laurenz Albe wrote:
> On Fri, 2022-11-18 at 11:11 +0100, Thomas Kellerer wrote:
>> Thomas Kellerer schrieb am 04.11.2022 um 10:19:
>>> I can easily calculate the average block read time using
>>> pg_stat_database and divide blk_read_time by blks_read.
>>>
>>> While there is a column blk_write_time, it seems that there is no
>>> cummulative measure for the total number of blocks written.
>>>
>> Any ideas on how to get the equivalent of (blk_read_time / blks_read) for blk_write_time?
>>
>> I thought about using tup_updated + tup_inserted + tup_deleted because each tuple change would require at least one block written.
>> However, a single block write could update multiple tuples so the result of that wouldn't be accurate (too low).
> You cannot get that, because most writes are done by the checkpointer, and
> that does not distinguish between databases.

For a similar reason to why WAL files can't be be "single database" without
significant rewrite?

--
Angular momentum makes the world go 'round.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2022-11-18 16:18:18 Re: copy databases from two differend backups to one cluster
Previous Message Laurenz Albe 2022-11-18 15:51:45 Re: Calculating average block write time