[HACKERS] pg_stat_wal_write statistics view - Mailing list pgsql-hackers

From Haribabu Kommi
Subject [HACKERS] pg_stat_wal_write statistics view
Date
Msg-id CAJrrPGc6APFUGYNcPe4qcNxpL8gXKYv1KST+vwJcFtCSCEySnA@mail.gmail.com
Whole thread Raw
Responses Re: [HACKERS] pg_stat_wal_write statistics view  (Amit Kapila <amit.kapila16@gmail.com>)
List 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 | Default 
-----------------------+--------------------------+-----------+----------+---------
 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.

Opinions?
 
Regards,
Hari Babu
Fujitsu Australia

pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: [HACKERS] GSoC 2017
Next
From: Beena Emerson
Date:
Subject: Re: [HACKERS] Proposal : For Auto-Prewarm.