mirror of
https://github.com/percona/pg_stat_monitor.git
synced 2026-02-04 14:06:20 +00:00
PG-320: Removing the query state code from the view.
The query status monitoring code was used to track the current query state, for example, parsing, executing and finishing. After careful review, we have figured out that it does not make sense while a lot of time same query is running. Therefore it is also consuming resources. This commit will remove that feature. The upgrade SQL from 1.0 - 2.0 is also updated.
This commit is contained in:
@@ -24,24 +24,23 @@ SELECT add2(1,2);
|
||||
(1 row)
|
||||
|
||||
SELECT query, top_query FROM pg_stat_monitor ORDER BY query COLLATE "C";
|
||||
query | top_query
|
||||
-------------------------------------------------------------------------+------------------
|
||||
(select $1 + $2) | SELECT add2(1,2)
|
||||
CREATE OR REPLACE FUNCTION add(int, int) RETURNS INTEGER AS +|
|
||||
$$ +|
|
||||
BEGIN +|
|
||||
return (select $1 + $2); +|
|
||||
END; $$ language plpgsql |
|
||||
CREATE OR REPLACE function add2(int, int) RETURNS int as +|
|
||||
$$ +|
|
||||
BEGIN +|
|
||||
return add($1,$2); +|
|
||||
END; +|
|
||||
$$ language plpgsql |
|
||||
SELECT add2(1,2) |
|
||||
SELECT pg_stat_monitor_reset() |
|
||||
SELECT query, top_query FROM pg_stat_monitor ORDER BY query COLLATE "C" |
|
||||
(6 rows)
|
||||
query | top_query
|
||||
-------------------------------------------------------------+------------------
|
||||
CREATE OR REPLACE FUNCTION add(int, int) RETURNS INTEGER AS+|
|
||||
$$ +|
|
||||
BEGIN +|
|
||||
return (select $1 + $2); +|
|
||||
END; $$ language plpgsql |
|
||||
CREATE OR REPLACE function add2(int, int) RETURNS int as +|
|
||||
$$ +|
|
||||
BEGIN +|
|
||||
return add($1,$2); +|
|
||||
END; +|
|
||||
$$ language plpgsql |
|
||||
SELECT (select $1 + $2) | SELECT add2(1,2)
|
||||
SELECT add2(1,2) |
|
||||
SELECT pg_stat_monitor_reset() |
|
||||
(5 rows)
|
||||
|
||||
SELECT pg_stat_monitor_reset();
|
||||
pg_stat_monitor_reset
|
||||
|
||||
Reference in New Issue
Block a user