Created
May 11, 2015 22:52
-
-
Save dpirotte/00c7dc2086910369e035 to your computer and use it in GitHub Desktop.
pg_stat_bgwriter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
(100 * checkpoints_req) / | |
(checkpoints_timed + checkpoints_req) AS checkpoints_req_pct, | |
pg_size_pretty(buffers_checkpoint * block_size / | |
(checkpoints_timed + checkpoints_req)) AS avg_checkpoint_write, | |
pg_size_pretty(block_size * | |
(buffers_checkpoint + buffers_clean + buffers_backend)) AS total_written, | |
100 * buffers_checkpoint / | |
(buffers_checkpoint + buffers_clean + buffers_backend) AS checkpoint_write_pct, | |
100 * buffers_backend / | |
(buffers_checkpoint + buffers_clean + buffers_backend) AS backend_write_pct, | |
* | |
FROM pg_stat_bgwriter, | |
(SELECT cast(current_setting('block_size') AS integer) AS block_size) bs; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment