From: | Scott Ribe <scott_ribe(at)elevated-dev(dot)com> |
---|---|
To: | pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org> |
Subject: | system catalog performance |
Date: | 2021-10-01 14:21:43 |
Message-ID: | 3DA944AB-CCDB-4A74-8562-691D02FD0F2E@elevated-dev.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
Under what circumstances would the following query be extra slow?
SELECT
pg_catalog.to_char(pg_catalog.pg_postmaster_start_time(), 'YYYY-MM-DD HH24:MI:SS.MS TZ'),
CASE WHEN pg_catalog.pg_is_in_recovery() THEN 0 ELSE ('x' || pg_catalog.substr(pg_catalog.pg_walfile_name(pg_catalog.pg_current_wal_lsn()), 1, 8))::bit(32)::int END,
CASE WHEN pg_catalog.pg_is_in_recovery() THEN 0 ELSE pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_current_wal_lsn(), '0/0')::bigint END,
pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_last_wal_replay_lsn(), '0/0')::bigint,
pg_catalog.pg_wal_lsn_diff(COALESCE(pg_catalog.pg_last_wal_receive_lsn(), '0/0'), '0/0')::bigint,
pg_catalog.pg_is_in_recovery() AND pg_catalog.pg_is_wal_replay_paused(),
pg_catalog.to_char(pg_catalog.pg_last_xact_replay_timestamp(), 'YYYY-MM-DD HH24:MI:SS.MS TZ'),
pg_catalog.array_to_json(pg_catalog.array_agg(pg_catalog.row_to_json(ri)))
FROM (
SELECT
(SELECT rolname FROM pg_authid WHERE oid = usesysid) AS usename,
application_name,
client_addr,
w.state,
sync_state,
sync_priority
FROM pg_catalog.pg_stat_get_wal_senders() w, pg_catalog.pg_stat_get_activity(pid)
) as ri;
This is regarding Patroni--I haven't yet dug into that source to see how long that timeout is. PG 13.3, monitoring did not show heavy load nor unusual lock activity around when this happened.
From | Date | Subject | |
---|---|---|---|
Next Message | Sanjeev Randhaye | 2021-10-02 03:28:09 | Pi nwtwork |
Previous Message | Henry Francisco Garcia Cortez | 2021-09-30 19:55:26 | bgwriter_lru_multiplier |