mirror of
https://github.com/percona/pg_stat_monitor.git
synced 2026-02-04 22:16:20 +00:00
PG-147: Store top query, instead of parent query.
This commit is contained in:
@@ -31,7 +31,7 @@ CREATE FUNCTION pg_stat_monitor(IN showtext boolean,
|
||||
OUT client_ip int8,
|
||||
|
||||
OUT queryid text,
|
||||
OUT parentid text,
|
||||
OUT top_queryid text,
|
||||
OUT query text,
|
||||
OUT application_name text,
|
||||
OUT relations text,
|
||||
@@ -126,9 +126,9 @@ CREATE VIEW pg_stat_monitor AS SELECT
|
||||
datname,
|
||||
'0.0.0.0'::inet + client_ip AS client_ip,
|
||||
queryid,
|
||||
parentid,
|
||||
top_queryid,
|
||||
query,
|
||||
(SELECT query from pg_stat_monitor(true) s where s.queryid = p.parentid) AS parent_query,
|
||||
(SELECT query from pg_stat_monitor(true) s where s.queryid = p.top_queryid) AS top_query,
|
||||
application_name,
|
||||
string_to_array(relations, ',') AS relations,
|
||||
cmd_type,
|
||||
|
||||
Reference in New Issue
Block a user