mirror of
https://github.com/percona/pg_stat_monitor.git
synced 2026-02-04 14:06:20 +00:00
PG-186: Add support to monitor query execution plan.
This requires refactoring of code to add this functionality. Along with that this patch contains regression test cases.
This commit is contained in:
53
regression/expected/user.out
Normal file
53
regression/expected/user.out
Normal file
@@ -0,0 +1,53 @@
|
||||
DROP USER IF EXISTS su;
|
||||
CREATE USER su WITH SUPERUSER;
|
||||
SET ROLE su;
|
||||
CREATE EXTENSION pg_stat_monitor;
|
||||
CREATE USER u1;
|
||||
CREATE USER u2;
|
||||
SET ROLE su;
|
||||
SELECT pg_stat_monitor_reset();
|
||||
pg_stat_monitor_reset
|
||||
-----------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
SET ROLE u1;
|
||||
CREATE TABLE t1 (a int);
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
---
|
||||
(0 rows)
|
||||
|
||||
SET ROLE u2;
|
||||
CREATE TABLE t2 (a int);
|
||||
SELECT * FROM t2;
|
||||
a
|
||||
---
|
||||
(0 rows)
|
||||
|
||||
SET ROLE su;
|
||||
SELECT userid, query FROM pg_stat_monitor ORDER BY query COLLATE "C";
|
||||
userid | query
|
||||
--------+-----------------------------------------------------------------------
|
||||
u1 | CREATE TABLE t1 (a int);
|
||||
u2 | CREATE TABLE t2 (a int);
|
||||
u1 | SELECT * FROM t1;
|
||||
u2 | SELECT * FROM t2;
|
||||
su | SELECT pg_stat_monitor_reset();
|
||||
su | SELECT userid, query FROM pg_stat_monitor ORDER BY query COLLATE "C";
|
||||
su | SET ROLE su;
|
||||
u1 | SET ROLE u1;
|
||||
u2 | SET ROLE u2;
|
||||
(9 rows)
|
||||
|
||||
SELECT pg_stat_monitor_reset();
|
||||
pg_stat_monitor_reset
|
||||
-----------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP USER u1;
|
||||
DROP USER u2;
|
||||
DROP EXTENSION pg_stat_monitor;
|
||||
Reference in New Issue
Block a user