I found that PostgreSQL 15.3 doesn't support the pg_stat_checkpointer view. We can use pg_stat_bgwriter instead. The SQL is as follows:
SELECT checkpoints_timed AS num_timed, -- Checkpoints triggered by timeout checkpoints_req AS num_requested, -- Checkpoints triggered by requests (like when WAL space is tight) round( (checkpoints_req::numeric / NULLIF(checkpoints_timed + checkpoints_req, 0)) * 100, 2 ) AS requested_pct -- % of checkpoints that were request-triggered
FROM pg_stat_bgwriter;
Hi, You could also use this query, if the ratio is low, that means there is no pressure on wal size and you can keep the max_wal_size value as it is. SELECT num_timed, num_requested, round((num_requested: : numeric / NULLIF(num_timed + num_requested,
ZjQcmQRYFpfptBannerStart
This Message Is From an Untrusted Sender
You have not previously corresponded with this sender.
ZjQcmQRYFpfptBannerEnd
Hi,
You could also use this query, if the ratio is low, that means there is no pressure on wal size and you can keep the max_wal_size value as it is.