Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mWJQA-0004GZ-Dz for pgsql-admin@arkaria.postgresql.org; Fri, 01 Oct 2021 14:21:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mWJQ9-00083U-Dz for pgsql-admin@arkaria.postgresql.org; Fri, 01 Oct 2021 14:21:53 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mWJQ9-00080y-4t for pgsql-admin@lists.postgresql.org; Fri, 01 Oct 2021 14:21:53 +0000 Received: from mailout.easymail.ca ([64.68.200.34]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mWJQ3-0000E0-Vc for pgsql-admin@lists.postgresql.org; Fri, 01 Oct 2021 14:21:52 +0000 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id C8C85E3F20 for ; Fri, 1 Oct 2021 14:21:45 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at emo01-pco.easydns.vpn Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo01-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FZQofld3zDqH for ; Fri, 1 Oct 2021 14:21:44 +0000 (UTC) Received: from smtpclient.apple (unknown [4.28.96.150]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id A30C6E3EFA for ; Fri, 1 Oct 2021 14:21:44 +0000 (UTC) From: Scott Ribe Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: system catalog performance Message-Id: <3DA944AB-CCDB-4A74-8562-691D02FD0F2E@elevated-dev.com> Date: Fri, 1 Oct 2021 08:21:43 -0600 To: pgsql-admin X-Mailer: Apple Mail (2.3654.120.0.1.13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Under what circumstances would the following query be extra slow? SELECT=20 pg_catalog.to_char(pg_catalog.pg_postmaster_start_time(), 'YYYY-MM-DD = HH24:MI:SS.MS TZ'),=20 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,=20 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,=20 pg_catalog.pg_wal_lsn_diff(pg_catalog.pg_last_wal_replay_lsn(), = '0/0')::bigint,=20 = pg_catalog.pg_wal_lsn_diff(COALESCE(pg_catalog.pg_last_wal_receive_lsn(), = '0/0'), '0/0')::bigint,=20 pg_catalog.pg_is_in_recovery() AND = pg_catalog.pg_is_wal_replay_paused(),=20 pg_catalog.to_char(pg_catalog.pg_last_xact_replay_timestamp(), = 'YYYY-MM-DD HH24:MI:SS.MS TZ'),=20 = pg_catalog.array_to_json(pg_catalog.array_agg(pg_catalog.row_to_json(ri)))= =20 FROM ( SELECT=20 (SELECT rolname FROM pg_authid WHERE oid =3D usesysid) AS usename,=20= application_name,=20 client_addr,=20 w.state,=20 sync_state, sync_priority=20 FROM pg_catalog.pg_stat_get_wal_senders() w, = pg_catalog.pg_stat_get_activity(pid) ) as ri;=EF=BB=BF 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.=