Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qus0L-001x5X-Rd for pgsql-hackers@arkaria.postgresql.org; Mon, 23 Oct 2023 10:17:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qus0J-007iZK-EU for pgsql-hackers@arkaria.postgresql.org; Mon, 23 Oct 2023 10:17:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qus0J-007iZB-4G for pgsql-hackers@lists.postgresql.org; Mon, 23 Oct 2023 10:17:47 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qus0G-002EXz-6j for pgsql-hackers@lists.postgresql.org; Mon, 23 Oct 2023 10:17:47 +0000 Received: from [192.168.0.104] (unknown [62.217.185.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: p.luzanov@postgrespro.ru) by mail.postgrespro.ru (Postfix/587) with ESMTPSA id 14286E20E70; Mon, 23 Oct 2023 13:17:43 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1698056263; bh=Z/gSqwi8ig8xXug/6+pu0XrrHZcxDIO1MxvTYsZF2gY=; h=Message-ID:Date:User-Agent:Subject:To:Cc:References:From: In-Reply-To:From; b=hY02NKUpNhlghjwHcHEBplatiByuf404M6PmE8D9Tctbyj2ftbnAlK3BkpxNwkYMs RU9IQeiU+l7etKv+C4ONWKERspWjErJjrwchhqZW6ehKx5+9a9iXuJn9W4F/AeRlfe U6aTQJX6q31gxquC65LnNyYCO2scXRGPhC1MqhfSDuVIGqGt4PhABRPSXtu/3dxpGO S4ZN8ehamh8zDYrqqXQgm+LL366mzyrQlCzU1PHQgbXi1aYaDsEPqNX0BeA0TA/WQM VtoBtaqbGJILZQcVnZcemH93LYHUrK93SvQOhvLp2sMtQGJwU9I6Nq7gzK6jzTMj2n s9R6hBWr3RFEw== Content-Type: multipart/mixed; boundary="------------lZCrN8dAhCGCN9k0WXw0TB3t" Message-ID: <4f79be75-7e30-4817-b0da-4a691ea5427f@postgrespro.ru> Date: Mon, 23 Oct 2023 13:17:42 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: WIP: new system catalog pg_wait_event Content-Language: en-US, ru-RU To: "Drouvot, Bertrand" , Michael Paquier Cc: Masahiro Ikeda , Kyotaro Horiguchi , tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org References: <735fbd560ae914c96faaa23cc8d9a118@oss.nttdata.com> <393fe340ab6980f399402a7dfbe13c4c@oss.nttdata.com> <0159e907-890d-4f11-8754-0311d7027bb7@gmail.com> <4fb03626-79aa-4c10-a002-2e5b71e65d22@gmail.com> <6f507a90-55db-4804-b360-eea4170d15fb@gmail.com> <1e0e03a5-1aee-44d9-b409-081afc142603@gmail.com> From: Pavel Luzanov In-Reply-To: <1e0e03a5-1aee-44d9-b409-081afc142603@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------lZCrN8dAhCGCN9k0WXw0TB3t Content-Type: multipart/alternative; boundary="------------5USoh6xJXAA1TgH2wF0kU7I6" --------------5USoh6xJXAA1TgH2wF0kU7I6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Please, consider this small fix for the query example in the docs[1]: SELECT a.pid, a.wait_event, w.description FROM pg_stat_activity a JOIN pg_wait_events w ON (a.wait_event_type = w.type AND a.wait_event = w.name) WHERE wait_event is NOT NULL and a.state = 'active'; I propose to add a table alias for the wait_event column in the WHERE clause for consistency. 1.https://www.postgresql.org/docs/devel/monitoring-stats.html#MONITORING-PG-STAT-ACTIVITY-VIEW -- Pavel Luzanov Postgres Professional:https://postgrespro.com --------------5USoh6xJXAA1TgH2wF0kU7I6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
Please, consider this small fix for the query example in the docs[1]:
SELECT a.pid, a.wait_event, w.description
  FROM pg_stat_activity a JOIN
       pg_wait_events w ON (a.wait_event_type = w.type AND
                            a.wait_event = w.name)
  WHERE wait_event is NOT NULL and a.state = 'active';

I propose to add a table alias for the wait_event column in the WHERE clause for consistency.

1. https://www.postgresql.org/docs/devel/monitoring-stats.html#MONITORING-PG-STAT-ACTIVITY-VIEW
-- 
Pavel Luzanov
Postgres Professional: https://postgrespro.com
--------------5USoh6xJXAA1TgH2wF0kU7I6-- --------------lZCrN8dAhCGCN9k0WXw0TB3t Content-Type: text/x-patch; charset=UTF-8; name="0001-Fix-pg_wait_events-usage-example.patch" Content-Disposition: attachment; filename="0001-Fix-pg_wait_events-usage-example.patch" Content-Transfer-Encoding: base64 RnJvbSA2NGU5YWE4ZGRkZTM5MmI5N2JmZjY2ZDUzYTVkMDllMGE4MjAzODBjIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBQYXZlbCBMdXphbm92IDxwLmx1emFub3ZAcG9zdGdy ZXNwcm8ucnU+CkRhdGU6IE1vbiwgMjMgT2N0IDIwMjMgMTM6MDA6MTYgKzAzMDAKU3ViamVj dDogW1BBVENIXSBGaXggcGdfd2FpdF9ldmVudHMgdXNhZ2UgZXhhbXBsZQoKVGhpcyBtYWtl cyB0aGUgdXNlIG9mIGNvbHVtbiBhbGlhc2VzIGNvbnNpc3RlbnQgdGhyb3VnaG91dCB0aGUg cXVlcnkuCi0tLQogZG9jL3NyYy9zZ21sL21vbml0b3Jpbmcuc2dtbCB8IDIgKy0KIDEgZmls ZSBjaGFuZ2VkLCAxIG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