pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Thomas Kellerer <shammat@gmx.net>
To: pgsql-general@lists.postgresql.org
Subject: Re: Calculating average block write time
Date: Fri, 18 Nov 2022 16:51:45 +0100
Message-ID: <075d05c6d4cdc01cc2467faded785a1ff77b1395.camel@cybertec.at> (raw)
In-Reply-To: <b68058f6-02d3-52ad-e997-9f42f7443a72@gmx.net>
References: <90374fa3-d750-e1ab-2fad-eaa7142f6b5a@gmx.net>
	<b68058f6-02d3-52ad-e997-9f42f7443a72@gmx.net>

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.

Yours,
Laurenz Albe
-- 
+43-670-6056265
CYBERTEC PostgreSQL International GmbH
Römerstraße 19, 2752 Wöllersdorf
Web: https://www.cybertec-postgresql.com





view thread (6+ messages)  latest in thread

Message-ID: <075d05c6d4cdc01cc2467faded785a1ff77b1395.camel@cybertec.at>
Permalink:  ../075d05c6d4cdc01cc2467faded785a1ff77b1395.camel@cybertec.at/
Also on:    postgresql.org/message-id/075d05c6d4cdc01cc2467faded785a1ff77b1395.camel@cybertec.at

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, shammat@gmx.net
  Subject: Re: Calculating average block write time
  In-Reply-To: <075d05c6d4cdc01cc2467faded785a1ff77b1395.camel@cybertec.at>
  References: <90374fa3-d750-e1ab-2fad-eaa7142f6b5a@gmx.net> <b68058f6-02d3-52ad-e997-9f42f7443a72@gmx.net> <075d05c6d4cdc01cc2467faded785a1ff77b1395.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox