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:
54
regression/expected/database.out
Normal file
54
regression/expected/database.out
Normal file
@@ -0,0 +1,54 @@
|
||||
CREATE EXTENSION pg_stat_monitor;
|
||||
CREATE DATABASE db1;
|
||||
CREATE DATABASE db2;
|
||||
\c db1
|
||||
CREATE TABLE t1 (a int);
|
||||
CREATE TABLE t2 (b int);
|
||||
\c db2
|
||||
CREATE TABLE t3 (c int);
|
||||
CREATE TABLE t4 (d int);
|
||||
\c contrib_regression
|
||||
SELECT pg_stat_monitor_reset();
|
||||
pg_stat_monitor_reset
|
||||
-----------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
\c db1
|
||||
SELECT * FROM t1,t2 WHERE t1.a = t2.b;
|
||||
a | b
|
||||
---+---
|
||||
(0 rows)
|
||||
|
||||
\c db2
|
||||
SELECT * FROM t3,t4 WHERE t3.c = t4.d;
|
||||
c | d
|
||||
---+---
|
||||
(0 rows)
|
||||
|
||||
\c contrib_regression
|
||||
SELECT datname, query FROM pg_stat_monitor ORDER BY query COLLATE "C";
|
||||
datname | query
|
||||
--------------------+------------------------------------------------------------------------
|
||||
db1 | SELECT * FROM t1,t2 WHERE t1.a = t2.b;
|
||||
db2 | SELECT * FROM t3,t4 WHERE t3.c = t4.d;
|
||||
contrib_regression | SELECT datname, query FROM pg_stat_monitor ORDER BY query COLLATE "C";
|
||||
contrib_regression | SELECT pg_stat_monitor_reset();
|
||||
(4 rows)
|
||||
|
||||
SELECT pg_stat_monitor_reset();
|
||||
pg_stat_monitor_reset
|
||||
-----------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
\c db1
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
\c db2
|
||||
DROP TABLE t3;
|
||||
DROP TABLE t4;
|
||||
\c contrib_regression
|
||||
DROP DATABASE db1;
|
||||
DROP DATABASE db2;
|
||||
DROP EXTENSION pg_stat_monitor;
|
||||
Reference in New Issue
Block a user