pg_stat_wal_write statistics view

From: Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: pg_stat_wal_write statistics view
Date: 2017-02-07 06:17:25
Views: Raw Message | Whole Thread | Download mbox
Lists: pgsql-hackers

Hi Hackers,

I just want to discuss adding of a new statistics view that provides
the information of wal writing details as follows

postgres=# \d pg_stat_wal_writer
View "pg_catalog.pg_stat_wal_writer"
Column | Type | Collation | Nullable |
num_backend_writes | bigint | |
num_total_writes | bigint | | |
num_blocks | bigint | | |
total_write_time | bigint| | |
stats_reset | timestamp with time zone | | |

The columns of the view are
1. Total number of xlog writes that are called from the backend.
2. Total number of xlog writes that are called from both backend
and background workers. (This column can be changed to just
display on the background writes).
3. The number of the blocks that are written.
4. Total write_time of the IO operation it took, this variable data is
filled only when the track_io_timing GUC is enabled.
5. Last time when the stats are reset.

I feel this view information may be useful in finding out how much
time does backend may spend in writing the xlog, based on this
information, it may be possible to tune wal_writer_delay GUC.

Or it is possible to integrate the new columns into the existing
pg_stat_bgwriter view also.


Hari Babu
Fujitsu Australia


Browse pgsql-hackers by date

  From Date Subject
Next Message Beena Emerson 2017-02-07 06:23:10 Re: Proposal : For Auto-Prewarm.
Previous Message Amit Langote 2017-02-07 05:49:04 Re: GSoC 2017