PG-186: Add support to monitor query execution plan.

This commit is contained in:
Ibrar Ahmed
2021-03-17 18:56:39 +05:00
parent aa0ca050d5
commit e0fc683810
18 changed files with 499 additions and 533 deletions

View File

@@ -1,6 +1,7 @@
CREATE EXTENSION pg_stat_monitor;
CREATE TABLE t1(a int);
CREATE TABLE t2(b int);
ERROR: relation "t2" already exists
INSERT INTO t1 VALUES(generate_series(1,1000));
INSERT INTO t2 VALUES(generate_series(1,5000));
SELECT pg_stat_monitor_reset();
@@ -8540,15 +8541,14 @@ SELECt * FROM t2 WHERE b % 2 = 0;
(2500 rows)
SELECT query, rows FROM pg_stat_monitor ORDER BY query COLLATE "C";
query | rows
---------------------------------------------------------------------+------
SELECT * FROM t1 LIMIT $1 | 10
SELECT * FROM t1; | 1000
SELECT * FROM t2; | 5000
SELECT pg_stat_monitor_reset(); | 1
SELECT query, rows FROM pg_stat_monitor ORDER BY query COLLATE "C"; | 0
SELECt * FROM t2 WHERE b % $1 = $2 | 2500
(6 rows)
query | rows
-------------------------------------+------
SELECT * FROM t1 LIMIT $1 | 10
SELECT * FROM t1; | 1000
SELECT b FROM t2 FOR UPDATE; | 5000
SELECT pg_stat_monitor_reset(); | 1
SELECt * FROM t2 WHERE b % $1 = $2 | 2500
(5 rows)
SELECT pg_stat_monitor_reset();
pg_stat_monitor_reset