答复: empty,query_id, pg_stat_activity - Mailing list pgsql-bugs

From zhouenbing
Subject 答复: empty,query_id, pg_stat_activity
Date
Msg-id 000b01dc1d4c$865eec00$931cc400$@sunwoda-evb.com
Whole thread Raw
In response to Re: empty,query_id, pg_stat_activity  (Michael Paquier <michael@paquier.xyz>)
Responses Re: empty,query_id, pg_stat_activity
List pgsql-bugs
hello  Michael
    The application scenario for performing performance analysis on
Postgres through query_id is as follows:
First, monitor the events and query_ids of the active database sessions
during the current or past period by using the pg_stat_activity or
pg_active_session_history views to analyze performance issues. Then, quickly
locate the detailed execution information of the SQL statements by using the
query_id of the session SQL in the pg_stat_statements.
Aggregate and statistically analyze the performance of the SQL at different
time points in the past by aggregating in pg_stat_statements_history within
the specified time period.
However, at present, some active sessions in pg_stat_activity have empty
query_ids, which leads to many query_ids being empty in
pg_active_session_history as well. If Mr. Greg said that empty query_ids
indicate that the session SQL has not been executed, then I will exclude the
sessions with empty query_ids. But I think that if the SQL has not been
executed, the session status should be 'inactive' instead.




pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: empty,query_id, pg_stat_activity
Next
From: Raghvendra Mishra
Date:
Subject: Postgres immediately closing connection when `systemctl reboot` command is fired.