PG-544: Regression cleanup.
parent
741dea66a8
commit
1bc14fb759
|
@ -0,0 +1,36 @@
|
||||||
|
Create EXTENSION pg_stat_monitor;
|
||||||
|
SELECT pg_stat_monitor_reset();
|
||||||
|
pg_stat_monitor_reset
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
Set application_name = 'naeem' ;
|
||||||
|
SELECT 1 AS num;
|
||||||
|
num
|
||||||
|
-----
|
||||||
|
1
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
Set application_name = 'psql' ;
|
||||||
|
SELECT 1 AS num;
|
||||||
|
num
|
||||||
|
-----
|
||||||
|
1
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
SELECT query,application_name FROM pg_stat_monitor ORDER BY query, application_name COLLATE "C";
|
||||||
|
query | application_name
|
||||||
|
--------------------------------+------------------------------------
|
||||||
|
SELECT 1 AS num | naeem
|
||||||
|
SELECT 1 AS num | psql
|
||||||
|
SELECT pg_stat_monitor_reset() | pg_regress/application_name_unique
|
||||||
|
(3 rows)
|
||||||
|
|
||||||
|
SELECT pg_stat_monitor_reset();
|
||||||
|
pg_stat_monitor_reset
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
DROP EXTENSION pg_stat_monitor;
|
|
@ -0,0 +1,43 @@
|
||||||
|
CREATE EXTENSION pg_stat_monitor;
|
||||||
|
SELECT pg_stat_monitor_reset();
|
||||||
|
pg_stat_monitor_reset
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
CREATE TABLE t1 (a INTEGER);
|
||||||
|
CREATE TABLE t2 (b INTEGER);
|
||||||
|
INSERT INTO t1 VALUES(1);
|
||||||
|
SELECT a FROM t1;
|
||||||
|
a
|
||||||
|
---
|
||||||
|
1
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
UPDATE t1 SET a = 2;
|
||||||
|
DELETE FROM t1;
|
||||||
|
SELECT b FROM t2 FOR UPDATE;
|
||||||
|
b
|
||||||
|
---
|
||||||
|
(0 rows)
|
||||||
|
|
||||||
|
TRUNCATE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
SELECT query, cmd_type, cmd_type_text FROM pg_stat_monitor ORDER BY query COLLATE "C";
|
||||||
|
query | cmd_type | cmd_type_text
|
||||||
|
--------------------------------+----------+---------------
|
||||||
|
DELETE FROM t1 | 4 | DELETE
|
||||||
|
INSERT INTO t1 VALUES(1) | 3 | INSERT
|
||||||
|
SELECT a FROM t1 | 1 | SELECT
|
||||||
|
SELECT b FROM t2 FOR UPDATE | 1 | SELECT
|
||||||
|
SELECT pg_stat_monitor_reset() | 1 | SELECT
|
||||||
|
UPDATE t1 SET a = 2 | 2 | UPDATE
|
||||||
|
(6 rows)
|
||||||
|
|
||||||
|
SELECT pg_stat_monitor_reset();
|
||||||
|
pg_stat_monitor_reset
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
DROP EXTENSION pg_stat_monitor;
|
|
@ -0,0 +1,73 @@
|
||||||
|
CREATE EXTENSION pg_stat_monitor;
|
||||||
|
Set pg_stat_monitor.pgsm_track='all';
|
||||||
|
SELECT pg_stat_monitor_reset();
|
||||||
|
pg_stat_monitor_reset
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
CREATE TABLE t1 (a INTEGER);
|
||||||
|
CREATE TABLE t2 (b INTEGER);
|
||||||
|
CREATE TABLE t3 (c INTEGER);
|
||||||
|
CREATE TABLE t4 (d INTEGER);
|
||||||
|
SELECT pg_stat_monitor_reset();
|
||||||
|
pg_stat_monitor_reset
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
SELECT a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a;
|
||||||
|
a | b | c | d
|
||||||
|
---+---+---+---
|
||||||
|
(0 rows)
|
||||||
|
|
||||||
|
SELECT a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a;
|
||||||
|
a | b | c | d
|
||||||
|
---+---+---+---
|
||||||
|
(0 rows)
|
||||||
|
|
||||||
|
SELECT a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a;
|
||||||
|
a | b | c | d
|
||||||
|
---+---+---+---
|
||||||
|
(0 rows)
|
||||||
|
|
||||||
|
SELECT a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a;
|
||||||
|
a | b | c | d
|
||||||
|
---+---+---+---
|
||||||
|
(0 rows)
|
||||||
|
|
||||||
|
SELECT query,calls FROM pg_stat_monitor ORDER BY query COLLATE "C";
|
||||||
|
query | calls
|
||||||
|
---------------------------------------------------------------------------------+-------
|
||||||
|
SELECT a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a | 4
|
||||||
|
SELECT pg_stat_monitor_reset() | 1
|
||||||
|
(2 rows)
|
||||||
|
|
||||||
|
SELECT pg_stat_monitor_reset();
|
||||||
|
pg_stat_monitor_reset
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
do $$
|
||||||
|
declare
|
||||||
|
n integer:= 1;
|
||||||
|
begin
|
||||||
|
loop
|
||||||
|
PERFORM a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a;
|
||||||
|
exit when n = 1000;
|
||||||
|
n := n + 1;
|
||||||
|
end loop;
|
||||||
|
end $$;
|
||||||
|
SELECT query,calls FROM pg_stat_monitor ORDER BY query COLLATE "C";
|
||||||
|
query | calls
|
||||||
|
---------------------------------------------------------------------------------+-------
|
||||||
|
SELECT a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a | 1000
|
||||||
|
SELECT pg_stat_monitor_reset() | 1
|
||||||
|
(2 rows)
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
DROP TABLE t2;
|
||||||
|
DROP TABLE t3;
|
||||||
|
DROP TABLE t4;
|
||||||
|
DROP EXTENSION pg_stat_monitor;
|
|
@ -26,11 +26,10 @@ SELECT * from pg_stat_monitor_settings;
|
||||||
|
|
||||||
select datname, substr(query,0,100) as query, calls from pg_stat_monitor order by datname, query, calls desc Limit 20;
|
select datname, substr(query,0,100) as query, calls from pg_stat_monitor order by datname, query, calls desc Limit 20;
|
||||||
datname | query | calls
|
datname | query | calls
|
||||||
----------+-----------------------------------------------------------------------------------------------------+-------
|
----------+----------------------------------------+-------
|
||||||
postgres | SELECT * from pg_stat_monitor_settings | 1
|
postgres | SELECT * from pg_stat_monitor_settings | 1
|
||||||
postgres | SELECT pg_stat_monitor_reset() | 1
|
postgres | SELECT pg_stat_monitor_reset() | 1
|
||||||
postgres | select datname, substr(query,0,100) as query, calls from pg_stat_monitor order by datname, query, c | 1
|
(2 rows)
|
||||||
(3 rows)
|
|
||||||
|
|
||||||
SELECT * from pg_stat_monitor_settings;
|
SELECT * from pg_stat_monitor_settings;
|
||||||
name | value | default_value | description | minimum | maximum | options | restart
|
name | value | default_value | description | minimum | maximum | options | restart
|
||||||
|
|
|
@ -0,0 +1,114 @@
|
||||||
|
CREATE EXTENSION pg_stat_monitor;
|
||||||
|
SELECT pg_stat_monitor_reset();
|
||||||
|
pg_stat_monitor_reset
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
SELECT * from pg_stat_monitor_settings where name='pg_stat_monitor.pgsm_query_shared_buffer';
|
||||||
|
name | value | default_value | description | minimum | maximum | options | restart
|
||||||
|
------------------------------------------+-------+---------------+-------------------------------------------------------------------------------------------+---------+---------+---------+---------
|
||||||
|
pg_stat_monitor.pgsm_query_shared_buffer | 1 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
CREATE database example;
|
||||||
|
select datname, substr(query,0,150) as query, calls from pg_stat_monitor order by datname, query, calls desc Limit 20;
|
||||||
|
datname | query | calls
|
||||||
|
---------+---------------------------------------------------------------------------------------------------------------+-------
|
||||||
|
example | BEGIN | 10000
|
||||||
|
example | END | 10000
|
||||||
|
example | INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES ($1, $2, $3, $4, CURRENT_TIMESTAMP) | 10000
|
||||||
|
example | SELECT abalance FROM pgbench_accounts WHERE aid = $1 | 10000
|
||||||
|
example | UPDATE pgbench_accounts SET abalance = abalance + $1 WHERE aid = $2 | 10000
|
||||||
|
example | UPDATE pgbench_branches SET bbalance = bbalance + $1 WHERE bid = $2 | 10000
|
||||||
|
example | UPDATE pgbench_tellers SET tbalance = tbalance + $1 WHERE tid = $2 | 10000
|
||||||
|
example | alter table pgbench_accounts add primary key (aid) | 1
|
||||||
|
example | alter table pgbench_branches add primary key (bid) | 1
|
||||||
|
example | alter table pgbench_tellers add primary key (tid) | 1
|
||||||
|
example | begin | 1
|
||||||
|
example | commit | 1
|
||||||
|
example | copy pgbench_accounts from stdin | 1
|
||||||
|
example | create table pgbench_accounts(aid int not null,bid int,abalance int,filler char(84)) with (fillfactor=100) | 1
|
||||||
|
example | create table pgbench_branches(bid int not null,bbalance int,filler char(88)) with (fillfactor=100) | 1
|
||||||
|
example | create table pgbench_history(tid int,bid int,aid int,delta int,mtime timestamp,filler char(22)) | 1
|
||||||
|
example | create table pgbench_tellers(tid int not null,bid int,tbalance int,filler char(84)) with (fillfactor=100) | 1
|
||||||
|
example | drop table if exists pgbench_accounts, pgbench_branches, pgbench_history, pgbench_tellers | 1
|
||||||
|
example | insert into pgbench_branches(bid,bbalance) values($1,$2) | 100
|
||||||
|
example | insert into pgbench_tellers(tid,bid,tbalance) values ($1,$2,$3) | 1000
|
||||||
|
(20 rows)
|
||||||
|
|
||||||
|
SELECT pg_stat_monitor_reset();
|
||||||
|
pg_stat_monitor_reset
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
SELECT * from pg_stat_monitor_settings where name='pg_stat_monitor.pgsm_query_shared_buffer';
|
||||||
|
name | value | default_value | description | minimum | maximum | options | restart
|
||||||
|
------------------------------------------+-------+---------------+-------------------------------------------------------------------------------------------+---------+---------+---------+---------
|
||||||
|
pg_stat_monitor.pgsm_query_shared_buffer | 100 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
select datname, substr(query,0,150) as query, calls from pg_stat_monitor order by datname, query, calls desc Limit 20;
|
||||||
|
datname | query | calls
|
||||||
|
---------+---------------------------------------------------------------------------------------------------------------+-------
|
||||||
|
example | BEGIN | 10000
|
||||||
|
example | END | 10000
|
||||||
|
example | INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES ($1, $2, $3, $4, CURRENT_TIMESTAMP) | 10000
|
||||||
|
example | SELECT abalance FROM pgbench_accounts WHERE aid = $1 | 10000
|
||||||
|
example | UPDATE pgbench_accounts SET abalance = abalance + $1 WHERE aid = $2 | 10000
|
||||||
|
example | UPDATE pgbench_branches SET bbalance = bbalance + $1 WHERE bid = $2 | 10000
|
||||||
|
example | UPDATE pgbench_tellers SET tbalance = tbalance + $1 WHERE tid = $2 | 10000
|
||||||
|
example | alter table pgbench_accounts add primary key (aid) | 1
|
||||||
|
example | alter table pgbench_branches add primary key (bid) | 1
|
||||||
|
example | alter table pgbench_tellers add primary key (tid) | 1
|
||||||
|
example | begin | 1
|
||||||
|
example | commit | 1
|
||||||
|
example | copy pgbench_accounts from stdin | 1
|
||||||
|
example | create table pgbench_accounts(aid int not null,bid int,abalance int,filler char(84)) with (fillfactor=100) | 1
|
||||||
|
example | create table pgbench_branches(bid int not null,bbalance int,filler char(88)) with (fillfactor=100) | 1
|
||||||
|
example | create table pgbench_history(tid int,bid int,aid int,delta int,mtime timestamp,filler char(22)) | 1
|
||||||
|
example | create table pgbench_tellers(tid int not null,bid int,tbalance int,filler char(84)) with (fillfactor=100) | 1
|
||||||
|
example | drop table if exists pgbench_accounts, pgbench_branches, pgbench_history, pgbench_tellers | 1
|
||||||
|
example | insert into pgbench_branches(bid,bbalance) values($1,$2) | 100
|
||||||
|
example | insert into pgbench_tellers(tid,bid,tbalance) values ($1,$2,$3) | 1000
|
||||||
|
(20 rows)
|
||||||
|
|
||||||
|
SELECT pg_stat_monitor_reset();
|
||||||
|
pg_stat_monitor_reset
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
SELECT * from pg_stat_monitor_settings where name='pg_stat_monitor.pgsm_query_shared_buffer';
|
||||||
|
name | value | default_value | description | minimum | maximum | options | restart
|
||||||
|
------------------------------------------+-------+---------------+-------------------------------------------------------------------------------------------+---------+---------+---------+---------
|
||||||
|
pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
select datname, substr(query,0,150) as query, calls from pg_stat_monitor order by datname, query, calls desc Limit 20;
|
||||||
|
datname | query | calls
|
||||||
|
---------+---------------------------------------------------------------------------------------------------------------+-------
|
||||||
|
example | BEGIN | 10000
|
||||||
|
example | END | 10000
|
||||||
|
example | INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES ($1, $2, $3, $4, CURRENT_TIMESTAMP) | 10000
|
||||||
|
example | SELECT abalance FROM pgbench_accounts WHERE aid = $1 | 10000
|
||||||
|
example | UPDATE pgbench_accounts SET abalance = abalance + $1 WHERE aid = $2 | 10000
|
||||||
|
example | UPDATE pgbench_branches SET bbalance = bbalance + $1 WHERE bid = $2 | 10000
|
||||||
|
example | UPDATE pgbench_tellers SET tbalance = tbalance + $1 WHERE tid = $2 | 10000
|
||||||
|
example | alter table pgbench_accounts add primary key (aid) | 1
|
||||||
|
example | alter table pgbench_branches add primary key (bid) | 1
|
||||||
|
example | alter table pgbench_tellers add primary key (tid) | 1
|
||||||
|
example | begin | 1
|
||||||
|
example | commit | 1
|
||||||
|
example | copy pgbench_accounts from stdin | 1
|
||||||
|
example | create table pgbench_accounts(aid int not null,bid int,abalance int,filler char(84)) with (fillfactor=100) | 1
|
||||||
|
example | create table pgbench_branches(bid int not null,bbalance int,filler char(88)) with (fillfactor=100) | 1
|
||||||
|
example | create table pgbench_history(tid int,bid int,aid int,delta int,mtime timestamp,filler char(22)) | 1
|
||||||
|
example | create table pgbench_tellers(tid int not null,bid int,tbalance int,filler char(84)) with (fillfactor=100) | 1
|
||||||
|
example | drop table if exists pgbench_accounts, pgbench_branches, pgbench_history, pgbench_tellers | 1
|
||||||
|
example | insert into pgbench_branches(bid,bbalance) values($1,$2) | 100
|
||||||
|
example | insert into pgbench_tellers(tid,bid,tbalance) values ($1,$2,$3) | 1000
|
||||||
|
(20 rows)
|
||||||
|
|
||||||
|
Drop extension pg_stat_monitor;
|
|
@ -67,13 +67,13 @@ SELECT key, txt_0, value_0 FROM TBL_0;
|
||||||
UPDATE TBL_0 SET value_0 = 1681692777;
|
UPDATE TBL_0 SET value_0 = 1681692777;
|
||||||
select datname, substr(query,0,100) as query, calls from pg_stat_monitor order by datname, query, calls desc Limit 20;
|
select datname, substr(query,0,100) as query, calls from pg_stat_monitor order by datname, query, calls desc Limit 20;
|
||||||
datname | query | calls
|
datname | query | calls
|
||||||
----------+-------------------------------------------------------------------------------------------+-------
|
----------+-------------------------------------------------------------------+-------
|
||||||
postgres | CREATE TABLE TBL_0(key text primary key, txt_0 text, value_0 int) | 1
|
postgres | CREATE TABLE TBL_0(key text primary key, txt_0 text, value_0 int) | 1
|
||||||
postgres | INSERT INTO TBL_0(key, txt_0, value_0) VALUES('000000', '846930886', 1804289383) | 1
|
postgres | INSERT INTO TBL_0(key, txt_0, value_0) VALUES($1, $2, $3) | 1
|
||||||
postgres | SELECT * from pg_stat_monitor_settings where name='pg_stat_monitor.pgsm_normalized_query' | 1
|
postgres | SELECT * from pg_stat_monitor_settings where name=$1 | 1
|
||||||
postgres | SELECT key, txt_0, value_0 FROM TBL_0 | 2
|
postgres | SELECT key, txt_0, value_0 FROM TBL_0 | 2
|
||||||
postgres | SELECT pg_stat_monitor_reset() | 1
|
postgres | SELECT pg_stat_monitor_reset() | 1
|
||||||
postgres | UPDATE TBL_0 SET value_0 = 1681692777 | 1
|
postgres | UPDATE TBL_0 SET value_0 = $1 | 1
|
||||||
(6 rows)
|
(6 rows)
|
||||||
|
|
||||||
Drop extension pg_stat_monitor;
|
Drop extension pg_stat_monitor;
|
||||||
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
CREATE EXTENSION pg_stat_monitor;
|
||||||
|
SELECT pg_stat_monitor_reset();
|
||||||
|
pg_stat_monitor_reset
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
SELECT * from pg_stat_monitor_settings;
|
||||||
|
name | value | default_value | description | minimum | maximum | options | restart
|
||||||
|
------------------------------------------+--------+---------------+----------------------------------------------------------------------------------------------------------+---------+------------+----------------+---------
|
||||||
|
pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes
|
||||||
|
pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes
|
||||||
|
pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no
|
||||||
|
pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no
|
||||||
|
pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes
|
||||||
|
pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes
|
||||||
|
pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes
|
||||||
|
pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes
|
||||||
|
pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes
|
||||||
|
pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes
|
||||||
|
pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes
|
||||||
|
pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no
|
||||||
|
pg_stat_monitor.pgsm_track | top | top | Selects which statements are tracked by pg_stat_monitor. | | | none, top, all | no
|
||||||
|
pg_stat_monitor.pgsm_extract_comments | no | no | Enable/Disable extracting comments from queries. | | | yes, no | no
|
||||||
|
pg_stat_monitor.pgsm_track_planning | no | no | Selects whether planning statistics are tracked. | | | yes, no | no
|
||||||
|
(15 rows)
|
||||||
|
|
||||||
|
SELECT * from pg_stat_monitor_settings;
|
||||||
|
name | value | default_value | description | minimum | maximum | options | restart
|
||||||
|
------------------------------------------+--------+---------------+----------------------------------------------------------------------------------------------------------+---------+------------+----------------+---------
|
||||||
|
pg_stat_monitor.pgsm_max | 100 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes
|
||||||
|
pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes
|
||||||
|
pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no
|
||||||
|
pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no
|
||||||
|
pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes
|
||||||
|
pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes
|
||||||
|
pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes
|
||||||
|
pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes
|
||||||
|
pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes
|
||||||
|
pg_stat_monitor.pgsm_query_shared_buffer | 20 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes
|
||||||
|
pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes
|
||||||
|
pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no
|
||||||
|
pg_stat_monitor.pgsm_track | top | top | Selects which statements are tracked by pg_stat_monitor. | | | none, top, all | no
|
||||||
|
pg_stat_monitor.pgsm_extract_comments | no | no | Enable/Disable extracting comments from queries. | | | yes, no | no
|
||||||
|
pg_stat_monitor.pgsm_track_planning | no | no | Selects whether planning statistics are tracked. | | | yes, no | no
|
||||||
|
(15 rows)
|
||||||
|
|
||||||
|
SELECT query, calls, total_exec_time, min_exec_time, max_exec_time, mean_exec_time, stddev_exec_time from pg_stat_monitor;
|
||||||
|
query | calls | total_exec_time | min_exec_time | max_exec_time | mean_exec_time | stddev_exec_time
|
||||||
|
----------------------------------------+-------+-----------------+---------------+---------------+----------------+------------------
|
||||||
|
SELECT pg_stat_monitor_reset() | 1 | 0.0945 | 0.0945 | 0.0945 | 0.0945 | 0
|
||||||
|
SELECT * from pg_stat_monitor_settings | 2 | 0.1556 | 0.0772 | 0.0784 | 0.0778 | 0.0006
|
||||||
|
(2 rows)
|
||||||
|
|
||||||
|
SELECT pg_stat_monitor_reset();
|
||||||
|
pg_stat_monitor_reset
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
Drop extension pg_stat_monitor;
|
|
@ -0,0 +1,217 @@
|
||||||
|
CREATE EXTENSION pg_stat_monitor;
|
||||||
|
create table foo (id int generated by default as identity,col1 varchar(100) not null,primary key(id));
|
||||||
|
SELECT pg_stat_monitor_reset();
|
||||||
|
pg_stat_monitor_reset
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
SELECT * from pg_stat_monitor_settings where name='pg_stat_monitor.pgsm_overflow_target';
|
||||||
|
name | value | default_value | description | minimum | maximum | options | restart
|
||||||
|
--------------------------------------+-------+---------------+----------------------------------------------+---------+---------+---------+---------
|
||||||
|
pg_stat_monitor.pgsm_overflow_target | 0 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
SELECT substr(query, 0, 50), length(query), bucket, queryid, calls, elevel, sqlcode, message from pg_stat_monitor;
|
||||||
|
substr | length | bucket | queryid | calls | elevel | sqlcode | message
|
||||||
|
---------------------------------------------------+--------+--------+------------------+-------+--------+---------+---------
|
||||||
|
INSERT INTO TBL_1(key, txt_0, value_0) VALUES('00 | 81 | 4 | 425215546842CC9F | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0 FROM TBL_1 | 37 | 4 | 642812FD3BD60B9 | 1 | 0 | |
|
||||||
|
UPDATE TBL_3 SET value_0 = 1129566413 | 37 | 4 | 42C137E8296B7B13 | 1 | 0 | |
|
||||||
|
UPDATE TBL_0 SET value_0 = 1681692777 | 37 | 4 | 84E8FF47CCC35A79 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 69 | 4 | C368081377909E88 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_5(key, txt_0, value_0, txt_1, val | 285 | 4 | 4BFCEC3D6B8B2389 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0 FROM TBL_2 | 37 | 4 | 1AAF5BC84396638E | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_4(key, txt_0, value_0) VALUES('00 | 80 | 4 | F080D3EC62067A1B | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_5(key, txt_0, value_0) VALUES('00 | 81 | 4 | 4F3EA5E59FFA3EE | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_6(key, txt_0, value_0, txt_1, val | 119 | 4 | 1F9475F8C6FF7450 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 101 | 4 | 2E632329D6BF54D5 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0 FROM TBL_0 | 37 | 4 | 4717FB60E3CC503B | 1 | 0 | |
|
||||||
|
UPDATE TBL_3 SET value_0 = 184803526, value_1 = 4 | 57 | 4 | 777CC1DE559A3E66 | 1 | 0 | |
|
||||||
|
UPDATE TBL_1 SET value_0 = 1189641421 | 37 | 4 | 58307E26872267E6 | 1 | 0 | |
|
||||||
|
UPDATE TBL_3 SET value_0 = 137806862, value_1 = 4 | 98 | 4 | 29BE7C136A1E13BF | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_5(key, txt_0, value_0, txt_1, val | 243 | 4 | 531DD5B35CF7630A | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 85 | 4 | 5AF4EB1FDEE106F1 | 1 | 0 | |
|
||||||
|
UPDATE TBL_4 SET value_0 = 1843993368, value_1 = | 80 | 4 | A5791D1CFBB6FAA7 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0 FROM TBL_5 | 37 | 4 | 67C5269569CDB71E | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 69 | 4 | 8A3E62C8CDDD9733 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_3(key, txt_0, value_0) VALUES('00 | 81 | 4 | 3DBCC9E726D14CA1 | 1 | 0 | |
|
||||||
|
UPDATE TBL_4 SET value_0 = 1264095060, value_1 = | 59 | 4 | BF4BE35F437265F4 | 1 | 0 | |
|
||||||
|
CREATE TABLE TBL_1(key text primary key, txt_0 te | 90 | 4 | DA9FC3ABF2D1C209 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_4(key, txt_0, value_0, txt_1, val | 162 | 4 | C8F4FFB0C37A185B | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_5(key, txt_0, value_0, txt_1, val | 121 | 4 | 136E24529417D5E7 | 1 | 0 | |
|
||||||
|
UPDATE TBL_5 SET value_0 = 1573363368 | 37 | 4 | 19739EF080A9034 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 101 | 4 | D6221385FE7DE4A4 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1 FROM T | 53 | 4 | 64DCE08492228639 | 1 | 0 | |
|
||||||
|
CREATE TABLE TBL_4(key text primary key, txt_0 te | 165 | 4 | F0D9F5857E930C16 | 1 | 0 | |
|
||||||
|
UPDATE TBL_2 SET value_0 = 233665123, value_1 = 2 | 79 | 4 | F0E843B51DE2EE36 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_5(key, txt_0, value_0, txt_1, val | 160 | 4 | B361F9DF99F5D18E | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_4(key, txt_0, value_0, txt_1, val | 122 | 4 | B56564995B2EDD01 | 1 | 0 | |
|
||||||
|
UPDATE TBL_3 SET value_0 = 1424268980, value_1 = | 80 | 4 | 7A0CF7AC932A3BC6 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_4(key, txt_0, value_0, txt_1, val | 244 | 4 | FEE0AB71F441E443 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 69 | 4 | A0EA13F12EB2E052 | 1 | 0 | |
|
||||||
|
UPDATE TBL_5 SET value_0 = 111537764, value_1 = 3 | 143 | 4 | E860C5C5BCE2643A | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2(key, txt_0, value_0, txt_1, val | 160 | 4 | F7A6032CE4BBA59A | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_4(key, txt_0, value_0, txt_1, val | 204 | 4 | 4718A03D9F4B3A5 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_6(key, txt_0, value_0, txt_1, val | 162 | 4 | 3E4D3DB767D7AF30 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0 FROM TBL_4 | 37 | 4 | 21D40B37FE159591 | 1 | 0 | |
|
||||||
|
SELECT * from pg_stat_monitor_settings where name | 88 | 4 | 35336C79D4EE3E7A | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_5(key, txt_0, value_0, txt_1, val | 203 | 4 | 5EABBB0C356C813F | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_6(key, txt_0, value_0, txt_1, val | 204 | 4 | D802BBF5B8196E27 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 69 | 4 | F3B7BEF02629DA0D | 1 | 0 | |
|
||||||
|
CREATE TABLE TBL_2(key text primary key, txt_0 te | 115 | 4 | CE277C93214FCB24 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_6(key, txt_0, value_0, txt_1, val | 246 | 4 | 20B984D66BF8D2BA | 1 | 0 | |
|
||||||
|
CREATE TABLE TBL_0(key text primary key, txt_0 te | 65 | 4 | 2370BA7F69455FDE | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_3(key, txt_0, value_0, txt_1, val | 203 | 4 | E9DA5C8CD89D1A69 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 69 | 4 | 1664EFC58E5FC941 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 85 | 4 | 5E3AE9677A5CE42F | 1 | 0 | |
|
||||||
|
UPDATE TBL_4 SET value_0 = 855636226, value_1 = 1 | 102 | 4 | 60DF94323EB8A8F8 | 1 | 0 | |
|
||||||
|
UPDATE TBL_4 SET value_0 = 1036140795, value_1 = | 123 | 4 | C07B7ABFF0D106D7 | 1 | 0 | |
|
||||||
|
CREATE TABLE TBL_3(key text primary key, txt_0 te | 140 | 4 | E591CDC9199A2848 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 117 | 4 | FD5709FCD0DEDDFB | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_6(key, txt_0, value_0, txt_1, val | 289 | 4 | 50C68B38B49D9257 | 1 | 0 | |
|
||||||
|
UPDATE TBL_1 SET value_0 = 1025202362, value_1 = | 59 | 4 | 44EB0DD7B8765DBC | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2(key, txt_0, value_0, txt_1, val | 123 | 4 | 1042FB7071669FBD | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0 FROM TBL_6 | 37 | 4 | FB1B5C02DAB7A78B | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1 FROM T | 53 | 4 | 98EE98C0A136221F | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0 FROM TBL_3 | 37 | 4 | 20DBA6828489F5C | 1 | 0 | |
|
||||||
|
UPDATE TBL_5 SET value_0 = 289700723, value_1 = 1 | 100 | 4 | A4D049DB6C360F60 | 1 | 0 | |
|
||||||
|
UPDATE TBL_5 SET value_0 = 1373226340, value_1 = | 80 | 4 | 684C2BBAF832A4C | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1 FROM T | 53 | 4 | EE91B6DA51D9AD6C | 1 | 0 | |
|
||||||
|
UPDATE TBL_2 SET value_0 = 861021530, value_1 = 2 | 57 | 4 | 5A3B72B3D714FF8A | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_6(key, txt_0, value_0, txt_1, val | 326 | 4 | DAA3E6A3E8A8D8E7 | 1 | 0 | |
|
||||||
|
SELECT pg_stat_monitor_reset() | 30 | 4 | DED7C3BDC91B9C6D | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_3(key, txt_0, value_0, txt_1, val | 164 | 4 | F2F54F14A9D869BD | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 85 | 4 | 8383F8A61E7D75C5 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_1(key, txt_0, value_0, txt_1, val | 120 | 4 | 3E34961802B1F799 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_0(key, txt_0, value_0) VALUES('00 | 80 | 4 | 33BB7D634EA87EC0 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1 FROM T | 53 | 4 | DBFDB7981AEB07 | 1 | 0 | |
|
||||||
|
UPDATE TBL_4 SET value_0 = 2053999932 | 37 | 4 | 6FD98289D24978C2 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2(key, txt_0, value_0) VALUES('00 | 80 | 4 | C5934EEBC3AFA46B | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 85 | 4 | 1AE30BFC91FD9D56 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_3(key, txt_0, value_0, txt_1, val | 122 | 4 | CD952DBAE952CF6B | 1 | 0 | |
|
||||||
|
UPDATE TBL_5 SET value_0 = 1409959708, value_1 = | 59 | 4 | 5C786CA0895A64DF | 1 | 0 | |
|
||||||
|
UPDATE TBL_5 SET value_0 = 439493451, value_1 = 9 | 123 | 4 | 91718DC4B66BFC48 | 1 | 0 | |
|
||||||
|
CREATE TABLE TBL_6(key text primary key, txt_0 te | 215 | 4 | DB3EBF6DC67E61D0 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_6(key, txt_0, value_0) VALUES('00 | 80 | 4 | 68BA138F9F6BD81E | 1 | 0 | |
|
||||||
|
UPDATE TBL_2 SET value_0 = 336465782 | 36 | 4 | 912DEFFBDDE76F | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 101 | 4 | 2CA60B4B4BC6832D | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1 FROM T | 53 | 4 | 74A743B139055406 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1 FROM T | 53 | 4 | 7D707B541DCFB4DA | 1 | 0 | |
|
||||||
|
CREATE TABLE TBL_5(key text primary key, txt_0 te | 190 | 4 | D3A3EECC1A5320C1 | 1 | 0 | |
|
||||||
|
(84 rows)
|
||||||
|
|
||||||
|
SELECT count(queryid) from pg_stat_monitor;
|
||||||
|
count
|
||||||
|
-------
|
||||||
|
84
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
SELECT pg_stat_monitor_reset();
|
||||||
|
pg_stat_monitor_reset
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
SELECT * from pg_stat_monitor_settings where name='pg_stat_monitor.pgsm_overflow_target';
|
||||||
|
name | value | default_value | description | minimum | maximum | options | restart
|
||||||
|
--------------------------------------+-------+---------------+----------------------------------------------+---------+---------+---------+---------
|
||||||
|
pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
SELECT substr(query, 0, 50), length(query), bucket, queryid, calls, elevel, sqlcode, message from pg_stat_monitor;
|
||||||
|
substr | length | bucket | queryid | calls | elevel | sqlcode | message
|
||||||
|
---------------------------------------------------+--------+--------+------------------+-------+--------+---------+---------
|
||||||
|
SELECT key, txt_0, value_0 FROM TBL_2_0 | 39 | 5 | BEABFDEAD2814D49 | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_1 SET value_0 = 1189641421 | 39 | 5 | 8EB080EC0FE7A841 | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_5 SET value_0 = 1373226340, value_1 | 82 | 5 | F6027C98AE032981 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1 FROM T | 55 | 5 | 48162B33BC7640C3 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_2(key, txt_0, value_0, txt_1, v | 162 | 5 | 966BB8A73D9D0CB1 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_5(key, txt_0, value_0, txt_1, v | 287 | 5 | B86F5F013045BB35 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1 FROM T | 55 | 5 | 6F4658C0C4D476E4 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 71 | 5 | 2F9348F3E811B79A | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_5(key, txt_0, value_0) VALUES(' | 83 | 5 | 8AFE97DA5BA270F3 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 71 | 5 | 52AB50A6A1D5245A | 1 | 0 | |
|
||||||
|
SELECT * from pg_stat_monitor_settings where name | 88 | 5 | 35336C79D4EE3E7A | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1 FROM T | 55 | 5 | 2B56BD4846F0945A | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_5(key, txt_0, value_0, txt_1, v | 162 | 5 | 73D7DCDC196DA935 | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_2 SET value_0 = 233665123, value_1 = | 81 | 5 | 37B4252EA3D0ACD0 | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_5 SET value_0 = 111537764, value_1 = | 145 | 5 | 1F418B9A962BB6A1 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1 FROM T | 55 | 5 | B43A896BE23F7334 | 1 | 0 | |
|
||||||
|
CREATE TABLE TBL_2_2(key text primary key, txt_0 | 117 | 5 | 439CC4659745887A | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_2(key, txt_0, value_0, txt_1, v | 125 | 5 | 9CF25142A821A28A | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_5(key, txt_0, value_0, txt_1, v | 123 | 5 | 78B7E1236DE48707 | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_3 SET value_0 = 1129566413 | 39 | 5 | 6D9B5FD9B3ECB930 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_3(key, txt_0, value_0, txt_1, v | 205 | 5 | 2D60780B6E5147F4 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_6(key, txt_0, value_0, txt_1, v | 328 | 5 | 944D106C874E505F | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_3 SET value_0 = 137806862, value_1 = | 100 | 5 | 4826BD5A1850C3DB | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 103 | 5 | 2689FAB68E4D0D85 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_0(key, txt_0, value_0) VALUES(' | 82 | 5 | 8697D20BA92E0E4F | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_2(key, txt_0, value_0) VALUES(' | 82 | 5 | FF97B9D9C6F55008 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1 FROM T | 55 | 5 | 44008D5A23F76423 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0 FROM TBL_2_5 | 39 | 5 | 82535261690FDE1D | 1 | 0 | |
|
||||||
|
CREATE TABLE TBL_2_6(key text primary key, txt_0 | 217 | 5 | EC329A861A52B4EE | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_3(key, txt_0, value_0, txt_1, v | 124 | 5 | C09694BDCD5115CB | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_6(key, txt_0, value_0, txt_1, v | 164 | 5 | 9F00CFC22B8F5E50 | 1 | 0 | |
|
||||||
|
CREATE TABLE TBL_2_1(key text primary key, txt_0 | 92 | 5 | EB49AF77DF6ACE91 | 1 | 0 | |
|
||||||
|
CREATE TABLE TBL_2_3(key text primary key, txt_0 | 142 | 5 | F079ED304A17DBC5 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 71 | 5 | EE70E798E0D391B1 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 87 | 5 | 3A7949DB15452FA | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_5 SET value_0 = 1409959708, value_1 | 61 | 5 | C9A06B057D63F749 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 87 | 5 | AB3D91620522B027 | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_4 SET value_0 = 1843993368, value_1 | 82 | 5 | ED5B292A448E4E44 | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_0 SET value_0 = 1681692777 | 39 | 5 | D17CA038032BEF1 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0 FROM TBL_2_1 | 39 | 5 | EECA294B4F4BFA31 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0 FROM TBL_2_3 | 39 | 5 | 678DD130B42BE005 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_4(key, txt_0, value_0, txt_1, v | 164 | 5 | 38A7344ABD42E2D4 | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_4 SET value_0 = 2053999932 | 39 | 5 | 3681F525B0E1E277 | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_5 SET value_0 = 1573363368 | 39 | 5 | C18799329D899EB1 | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_4 SET value_0 = 1036140795, value_1 | 125 | 5 | 714EBA1E5D48D2F9 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_1(key, txt_0, value_0, txt_1, v | 122 | 5 | E67C2A4876991361 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_6(key, txt_0, value_0, txt_1, v | 248 | 5 | 5DA4769C51C5AADE | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0 FROM TBL_2_2 | 39 | 5 | A4945C687430A780 | 1 | 0 | |
|
||||||
|
CREATE TABLE TBL_2_4(key text primary key, txt_0 | 167 | 5 | 45D0728F70837703 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_4(key, txt_0, value_0, txt_1, v | 206 | 5 | B282D8834F6C7796 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 103 | 5 | 49C3BBB8EFB45A07 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0 FROM TBL_2_4 | 39 | 5 | 2B54471951894604 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 87 | 5 | 175EC70143A0B1EF | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 71 | 5 | 56787B092622E1F | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_4(key, txt_0, value_0, txt_1, v | 124 | 5 | DC3E349EB74C19E5 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_1(key, txt_0, value_0) VALUES(' | 83 | 5 | 7E999BC11FAAB01D | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_3(key, txt_0, value_0, txt_1, v | 166 | 5 | 578B4CBEC849C5AC | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_5 SET value_0 = 439493451, value_1 = | 125 | 5 | B613D1D1ADEA52D3 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 119 | 5 | C2D156A5412FCBBC | 1 | 0 | |
|
||||||
|
CREATE TABLE TBL_2_5(key text primary key, txt_0 | 192 | 5 | B3FA223A87014AE | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_2 SET value_0 = 336465782 | 38 | 5 | B3F9A1C4B84F1F6E | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_6(key, txt_0, value_0) VALUES(' | 82 | 5 | 20169C95EF903F83 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 71 | 5 | 8CF9F5BEF1F4EA82 | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_3 SET value_0 = 1424268980, value_1 | 82 | 5 | 3DF7E3F09F312E6C | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_2 SET value_0 = 861021530, value_1 = | 59 | 5 | F24B049D9A1F87B6 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 87 | 5 | 3B37D99AD3D9106D | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_6(key, txt_0, value_0, txt_1, v | 291 | 5 | 1BD7BE4EBEB871C6 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_4(key, txt_0, value_0) VALUES(' | 82 | 5 | 725801B5D3BF0FC7 | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_1 SET value_0 = 1025202362, value_1 | 61 | 5 | 840DA100E65E11AB | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_4 SET value_0 = 1264095060, value_1 | 61 | 5 | 867FF05B638DBE97 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0 FROM TBL_2_6 | 39 | 5 | E9518C2C857542D9 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1 FROM T | 55 | 5 | A2938DCD37EA0B53 | 1 | 0 | |
|
||||||
|
CREATE TABLE TBL_2_0(key text primary key, txt_0 | 67 | 5 | 2FDDD5D4F3A6A2E5 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_6(key, txt_0, value_0, txt_1, v | 121 | 5 | 1416EACC75B937AB | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_3 SET value_0 = 184803526, value_1 = | 59 | 5 | 481E62DF6E13F673 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_4(key, txt_0, value_0, txt_1, v | 246 | 5 | C0C08BEE90320 | 1 | 0 | |
|
||||||
|
SELECT pg_stat_monitor_reset() | 30 | 5 | DED7C3BDC91B9C6D | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_6(key, txt_0, value_0, txt_1, v | 206 | 5 | 4BAABE93F282D092 | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_5 SET value_0 = 289700723, value_1 = | 102 | 5 | 45E0C3BF1E276540 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_5(key, txt_0, value_0, txt_1, v | 205 | 5 | DF620AAF2D68C1B9 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_3(key, txt_0, value_0) VALUES(' | 83 | 5 | 3B74D31DC24049AE | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_5(key, txt_0, value_0, txt_1, v | 245 | 5 | ED14C4FF5E930055 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 103 | 5 | CEBAE05D2A5275B7 | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_4 SET value_0 = 855636226, value_1 = | 104 | 5 | 5FC4696DAD56E2EA | 1 | 0 | |
|
||||||
|
(84 rows)
|
||||||
|
|
||||||
|
SELECT count(queryid) from pg_stat_monitor;
|
||||||
|
count
|
||||||
|
-------
|
||||||
|
84
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
Drop extension pg_stat_monitor;
|
|
@ -0,0 +1,94 @@
|
||||||
|
CREATE EXTENSION pg_stat_monitor;
|
||||||
|
create table foo (id int generated by default as identity,col1 varchar(100) not null,primary key(id));
|
||||||
|
SELECT pg_stat_monitor_reset();
|
||||||
|
pg_stat_monitor_reset
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
SELECT * from pg_stat_monitor_settings;
|
||||||
|
name | value | default_value | description | minimum | maximum | options | restart
|
||||||
|
------------------------------------------+--------+---------------+----------------------------------------------------------------------------------------------------------+---------+------------+----------------+---------
|
||||||
|
pg_stat_monitor.pgsm_max | 1 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes
|
||||||
|
pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes
|
||||||
|
pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no
|
||||||
|
pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no
|
||||||
|
pg_stat_monitor.pgsm_max_buckets | 2 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes
|
||||||
|
pg_stat_monitor.pgsm_bucket_time | 1 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes
|
||||||
|
pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes
|
||||||
|
pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes
|
||||||
|
pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes
|
||||||
|
pg_stat_monitor.pgsm_query_shared_buffer | 1 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes
|
||||||
|
pg_stat_monitor.pgsm_overflow_target | 0 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes
|
||||||
|
pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no
|
||||||
|
pg_stat_monitor.pgsm_track | top | top | Selects which statements are tracked by pg_stat_monitor. | | | none, top, all | no
|
||||||
|
pg_stat_monitor.pgsm_extract_comments | no | no | Enable/Disable extracting comments from queries. | | | yes, no | no
|
||||||
|
pg_stat_monitor.pgsm_track_planning | no | no | Selects whether planning statistics are tracked. | | | yes, no | no
|
||||||
|
(15 rows)
|
||||||
|
|
||||||
|
SELECT substr(query, 0, 50), length(query), bucket, queryid, calls, elevel, sqlcode, message from pg_stat_monitor;
|
||||||
|
substr | length | bucket | queryid | calls | elevel | sqlcode | message
|
||||||
|
--------+--------+--------+---------+-------+--------+---------+---------
|
||||||
|
(0 rows)
|
||||||
|
|
||||||
|
SELECT count(queryid) from pg_stat_monitor;
|
||||||
|
count
|
||||||
|
-------
|
||||||
|
0
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
SELECT pg_stat_monitor_reset();
|
||||||
|
pg_stat_monitor_reset
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
SELECT * from pg_stat_monitor_settings;
|
||||||
|
name | value | default_value | description | minimum | maximum | options | restart
|
||||||
|
------------------------------------------+--------+---------------+----------------------------------------------------------------------------------------------------------+---------+------------+----------------+---------
|
||||||
|
pg_stat_monitor.pgsm_max | 1 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes
|
||||||
|
pg_stat_monitor.pgsm_query_max_len | 2048 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes
|
||||||
|
pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no
|
||||||
|
pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no
|
||||||
|
pg_stat_monitor.pgsm_max_buckets | 2 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes
|
||||||
|
pg_stat_monitor.pgsm_bucket_time | 1 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes
|
||||||
|
pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes
|
||||||
|
pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes
|
||||||
|
pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes
|
||||||
|
pg_stat_monitor.pgsm_query_shared_buffer | 1 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes
|
||||||
|
pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes
|
||||||
|
pg_stat_monitor.pgsm_enable_query_plan | no | no | Enable/Disable query plan monitoring | | | yes, no | no
|
||||||
|
pg_stat_monitor.pgsm_track | top | top | Selects which statements are tracked by pg_stat_monitor. | | | none, top, all | no
|
||||||
|
pg_stat_monitor.pgsm_extract_comments | no | no | Enable/Disable extracting comments from queries. | | | yes, no | no
|
||||||
|
pg_stat_monitor.pgsm_track_planning | no | no | Selects whether planning statistics are tracked. | | | yes, no | no
|
||||||
|
(15 rows)
|
||||||
|
|
||||||
|
SELECT substr(query, 0, 50), length(query), bucket, queryid, calls, elevel, sqlcode, message from pg_stat_monitor;
|
||||||
|
substr | length | bucket | queryid | calls | elevel | sqlcode | message
|
||||||
|
---------------------------------------------------+--------+--------+------------------+-------+--------+---------+---------
|
||||||
|
UPDATE TBL_2_81 SET value_0 = 1233558186, value_1 | 584 | 0 | 3701D68BEA093403 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 1408 | 1 | 9E24F6C78B91466D | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 1174 | 1 | DA018C53C04C08AE | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 1210 | 1 | 2B90260D4BC8A0DD | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 1264 | 1 | 202C5719118D470B | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 1192 | 1 | F1FD09DE4F81249A | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 1156 | 1 | 6293B3A1336BBE8B | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 1282 | 1 | C7815236554A7720 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 1300 | 1 | FFC2819A38F41A12 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 1372 | 1 | 6957581EA501B313 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 1354 | 1 | 600F171F94A7F721 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 1426 | 1 | 278C46300D46D0A3 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 1318 | 1 | 97D2167E4CB586A6 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 1336 | 1 | 92C3EFFB72E5290C | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 1228 | 1 | 38BD5BF75DFD7C17 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 1246 | 1 | 155693EA64D27308 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 1390 | 1 | 363709BA30BC1F27 | 1 | 0 | |
|
||||||
|
(17 rows)
|
||||||
|
|
||||||
|
SELECT count(queryid) from pg_stat_monitor;
|
||||||
|
count
|
||||||
|
-------
|
||||||
|
18
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
Drop extension pg_stat_monitor;
|
|
@ -0,0 +1,203 @@
|
||||||
|
CREATE EXTENSION pg_stat_monitor;
|
||||||
|
create table foo (id int generated by default as identity,col1 varchar(100) not null,primary key(id));
|
||||||
|
SELECT pg_stat_monitor_reset();
|
||||||
|
pg_stat_monitor_reset
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
SELECT * from pg_stat_monitor_settings;
|
||||||
|
name | value | default_value | description | minimum | maximum | options | restart
|
||||||
|
------------------------------------------+--------+---------------+----------------------------------------------------------------------------------------------------------+---------+------------+----------------+---------
|
||||||
|
pg_stat_monitor.pgsm_max | 1 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes
|
||||||
|
pg_stat_monitor.pgsm_query_max_len | 10000 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes
|
||||||
|
pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no
|
||||||
|
pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no
|
||||||
|
pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes
|
||||||
|
pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes
|
||||||
|
pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes
|
||||||
|
pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes
|
||||||
|
pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes
|
||||||
|
pg_stat_monitor.pgsm_query_shared_buffer | 1 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes
|
||||||
|
pg_stat_monitor.pgsm_overflow_target | 0 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes
|
||||||
|
pg_stat_monitor.pgsm_enable_query_plan | yes | no | Enable/Disable query plan monitoring | | | yes, no | no
|
||||||
|
pg_stat_monitor.pgsm_track | all | top | Selects which statements are tracked by pg_stat_monitor. | | | none, top, all | no
|
||||||
|
pg_stat_monitor.pgsm_extract_comments | yes | no | Enable/Disable extracting comments from queries. | | | yes, no | no
|
||||||
|
pg_stat_monitor.pgsm_track_planning | yes | no | Selects whether planning statistics are tracked. | | | yes, no | no
|
||||||
|
(15 rows)
|
||||||
|
|
||||||
|
SELECT substr(query, 0, 50), length(query), bucket, queryid, calls, elevel, sqlcode, message from pg_stat_monitor;
|
||||||
|
substr | length | bucket | queryid | calls | elevel | sqlcode | message
|
||||||
|
---------------------------------------------------+--------+--------+------------------+-------+--------+---------+---------
|
||||||
|
SELECT key, txt_0, value_0 FROM TBL_3 | 37 | 7 | 20DBA6828489F5C | 1 | 0 | |
|
||||||
|
CREATE TABLE TBL_5(key text primary key, txt_0 te | 190 | 7 | D3A3EECC1A5320C1 | 2 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 69 | 7 | 8A3E62C8CDDD9733 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1 FROM T | 53 | 7 | 98EE98C0A136221F | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2(key, txt_0, value_0, txt_1, val | 160 | 7 | F7A6032CE4BBA59A | 1 | 0 | |
|
||||||
|
CREATE TABLE TBL_3(key text primary key, txt_0 te | 140 | 7 | E591CDC9199A2848 | 2 | 0 | |
|
||||||
|
UPDATE TBL_2 SET value_0 = 233665123, value_1 = 2 | 79 | 7 | F0E843B51DE2EE36 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_5(key, txt_0, value_0, txt_1, val | 121 | 7 | 136E24529417D5E7 | 1 | 0 | |
|
||||||
|
UPDATE TBL_4 SET value_0 = 1036140795, value_1 = | 123 | 7 | C07B7ABFF0D106D7 | 1 | 0 | |
|
||||||
|
UPDATE TBL_4 SET value_0 = 1843993368, value_1 = | 80 | 7 | A5791D1CFBB6FAA7 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_4(key, txt_0, value_0) VALUES('00 | 80 | 7 | F080D3EC62067A1B | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1 FROM T | 53 | 7 | EE91B6DA51D9AD6C | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 69 | 7 | F3B7BEF02629DA0D | 1 | 0 | |
|
||||||
|
UPDATE TBL_3 SET value_0 = 1129566413 | 37 | 7 | 42C137E8296B7B13 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1 FROM T | 53 | 7 | DBFDB7981AEB07 | 1 | 0 | |
|
||||||
|
UPDATE TBL_2 SET value_0 = 861021530, value_1 = 2 | 57 | 7 | 5A3B72B3D714FF8A | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0 FROM TBL_4 | 37 | 7 | 21D40B37FE159591 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1 FROM T | 53 | 7 | 64DCE08492228639 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 101 | 7 | 2E632329D6BF54D5 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_5(key, txt_0, value_0, txt_1, val | 243 | 7 | 531DD5B35CF7630A | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_0(key, txt_0, value_0) VALUES('00 | 80 | 7 | 33BB7D634EA87EC0 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_5(key, txt_0, value_0, txt_1, val | 285 | 7 | 4BFCEC3D6B8B2389 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 85 | 7 | 5AF4EB1FDEE106F1 | 1 | 0 | |
|
||||||
|
SELECT * from pg_stat_monitor_settings | 38 | 7 | 1FC4A7E71F639F9D | 1 | 0 | |
|
||||||
|
CREATE TABLE TBL_0(key text primary key, txt_0 te | 65 | 7 | 2370BA7F69455FDE | 2 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 85 | 7 | 5E3AE9677A5CE42F | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_1(key, txt_0, value_0) VALUES('00 | 81 | 7 | 425215546842CC9F | 1 | 0 | |
|
||||||
|
UPDATE TBL_1 SET value_0 = 1189641421 | 37 | 7 | 58307E26872267E6 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2(key, txt_0, value_0) VALUES('00 | 80 | 7 | C5934EEBC3AFA46B | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_4(key, txt_0, value_0, txt_1, val | 162 | 7 | C8F4FFB0C37A185B | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_3(key, txt_0, value_0, txt_1, val | 164 | 7 | F2F54F14A9D869BD | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0 FROM TBL_0 | 37 | 7 | 4717FB60E3CC503B | 1 | 0 | |
|
||||||
|
UPDATE TBL_3 SET value_0 = 137806862, value_1 = 4 | 98 | 7 | 29BE7C136A1E13BF | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2(key, txt_0, value_0, txt_1, val | 123 | 7 | 1042FB7071669FBD | 1 | 0 | |
|
||||||
|
UPDATE TBL_0 SET value_0 = 1681692777 | 37 | 7 | 84E8FF47CCC35A79 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0 FROM TBL_1 | 37 | 7 | 642812FD3BD60B9 | 1 | 0 | |
|
||||||
|
CREATE TABLE TBL_1(key text primary key, txt_0 te | 90 | 7 | DA9FC3ABF2D1C209 | 2 | 0 | |
|
||||||
|
INSERT INTO TBL_1(key, txt_0, value_0, txt_1, val | 120 | 7 | 3E34961802B1F799 | 1 | 0 | |
|
||||||
|
SELECT pg_stat_monitor_reset() | 30 | 7 | DED7C3BDC91B9C6D | 1 | 0 | |
|
||||||
|
UPDATE TBL_4 SET value_0 = 2053999932 | 37 | 7 | 6FD98289D24978C2 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 69 | 7 | 1664EFC58E5FC941 | 1 | 0 | |
|
||||||
|
UPDATE TBL_3 SET value_0 = 184803526, value_1 = 4 | 57 | 7 | 777CC1DE559A3E66 | 1 | 0 | |
|
||||||
|
UPDATE TBL_2 SET value_0 = 336465782 | 36 | 7 | 912DEFFBDDE76F | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0 FROM TBL_5 | 37 | 7 | 67C5269569CDB71E | 1 | 0 | |
|
||||||
|
CREATE TABLE TBL_2(key text primary key, txt_0 te | 115 | 7 | CE277C93214FCB24 | 2 | 0 | |
|
||||||
|
INSERT INTO TBL_3(key, txt_0, value_0) VALUES('00 | 81 | 7 | 3DBCC9E726D14CA1 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_4(key, txt_0, value_0, txt_1, val | 244 | 7 | FEE0AB71F441E443 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_4(key, txt_0, value_0, txt_1, val | 204 | 7 | 4718A03D9F4B3A5 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_5(key, txt_0, value_0, txt_1, val | 160 | 7 | B361F9DF99F5D18E | 1 | 0 | |
|
||||||
|
UPDATE TBL_3 SET value_0 = 1424268980, value_1 = | 80 | 7 | 7A0CF7AC932A3BC6 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_5(key, txt_0, value_0, txt_1, val | 203 | 7 | 5EABBB0C356C813F | 1 | 0 | |
|
||||||
|
CREATE TABLE TBL_4(key text primary key, txt_0 te | 165 | 7 | F0D9F5857E930C16 | 2 | 0 | |
|
||||||
|
INSERT INTO TBL_4(key, txt_0, value_0, txt_1, val | 122 | 7 | B56564995B2EDD01 | 1 | 0 | |
|
||||||
|
UPDATE TBL_4 SET value_0 = 855636226, value_1 = 1 | 102 | 7 | 60DF94323EB8A8F8 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1 FROM T | 53 | 7 | 74A743B139055406 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_3(key, txt_0, value_0, txt_1, val | 122 | 7 | CD952DBAE952CF6B | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_3(key, txt_0, value_0, txt_1, val | 203 | 7 | E9DA5C8CD89D1A69 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 69 | 7 | C368081377909E88 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_5(key, txt_0, value_0) VALUES('00 | 81 | 7 | 4F3EA5E59FFA3EE | 1 | 0 | |
|
||||||
|
UPDATE TBL_1 SET value_0 = 1025202362, value_1 = | 59 | 7 | 44EB0DD7B8765DBC | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0 FROM TBL_2 | 37 | 7 | 1AAF5BC84396638E | 1 | 0 | |
|
||||||
|
UPDATE TBL_4 SET value_0 = 1264095060, value_1 = | 59 | 7 | BF4BE35F437265F4 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 85 | 7 | 1AE30BFC91FD9D56 | 1 | 0 | |
|
||||||
|
(63 rows)
|
||||||
|
|
||||||
|
SELECT count(queryid) from pg_stat_monitor;
|
||||||
|
count
|
||||||
|
-------
|
||||||
|
63
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
SELECT pg_stat_monitor_reset();
|
||||||
|
pg_stat_monitor_reset
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
SELECT * from pg_stat_monitor_settings;
|
||||||
|
name | value | default_value | description | minimum | maximum | options | restart
|
||||||
|
------------------------------------------+--------+---------------+----------------------------------------------------------------------------------------------------------+---------+------------+----------------+---------
|
||||||
|
pg_stat_monitor.pgsm_max | 1 | 100 | Sets the maximum size of shared memory in (MB) used for statement's metadata tracked by pg_stat_monitor. | 1 | 1000 | | yes
|
||||||
|
pg_stat_monitor.pgsm_query_max_len | 10000 | 2048 | Sets the maximum length of query. | 1024 | 2147483647 | | yes
|
||||||
|
pg_stat_monitor.pgsm_track_utility | yes | yes | Selects whether utility commands are tracked. | | | yes, no | no
|
||||||
|
pg_stat_monitor.pgsm_normalized_query | no | no | Selects whether save query in normalized format. | | | yes, no | no
|
||||||
|
pg_stat_monitor.pgsm_max_buckets | 10 | 10 | Sets the maximum number of buckets. | 1 | 10 | | yes
|
||||||
|
pg_stat_monitor.pgsm_bucket_time | 60 | 60 | Sets the time in seconds per bucket. | 1 | 2147483647 | | yes
|
||||||
|
pg_stat_monitor.pgsm_histogram_min | 0 | 0 | Sets the time in millisecond. | 0 | 2147483647 | | yes
|
||||||
|
pg_stat_monitor.pgsm_histogram_max | 100000 | 100000 | Sets the time in millisecond. | 10 | 2147483647 | | yes
|
||||||
|
pg_stat_monitor.pgsm_histogram_buckets | 10 | 10 | Sets the maximum number of histogram buckets | 2 | 50 | | yes
|
||||||
|
pg_stat_monitor.pgsm_query_shared_buffer | 1 | 20 | Sets the maximum size of shared memory in (MB) used for query tracked by pg_stat_monitor. | 1 | 10000 | | yes
|
||||||
|
pg_stat_monitor.pgsm_overflow_target | 1 | 1 | Sets the overflow target for pg_stat_monitor | 0 | 1 | | yes
|
||||||
|
pg_stat_monitor.pgsm_enable_query_plan | yes | no | Enable/Disable query plan monitoring | | | yes, no | no
|
||||||
|
pg_stat_monitor.pgsm_track | all | top | Selects which statements are tracked by pg_stat_monitor. | | | none, top, all | no
|
||||||
|
pg_stat_monitor.pgsm_extract_comments | yes | no | Enable/Disable extracting comments from queries. | | | yes, no | no
|
||||||
|
pg_stat_monitor.pgsm_track_planning | yes | no | Selects whether planning statistics are tracked. | | | yes, no | no
|
||||||
|
(15 rows)
|
||||||
|
|
||||||
|
SELECT substr(query, 0, 50), length(query), bucket, queryid, calls, elevel, sqlcode, message from pg_stat_monitor;
|
||||||
|
substr | length | bucket | queryid | calls | elevel | sqlcode | message
|
||||||
|
---------------------------------------------------+--------+--------+------------------+-------+--------+---------+---------
|
||||||
|
CREATE TABLE TBL_2_4(key text primary key, txt_0 | 167 | 8 | 45D0728F70837703 | 2 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1 FROM T | 55 | 8 | 44008D5A23F76423 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0 FROM TBL_2_4 | 39 | 8 | 2B54471951894604 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0 FROM TBL_2_1 | 39 | 8 | EECA294B4F4BFA31 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 87 | 8 | 175EC70143A0B1EF | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_2(key, txt_0, value_0, txt_1, v | 162 | 8 | 966BB8A73D9D0CB1 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 71 | 8 | EE70E798E0D391B1 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_2(key, txt_0, value_0) VALUES(' | 82 | 8 | FF97B9D9C6F55008 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0 FROM TBL_2_0 | 39 | 8 | BEABFDEAD2814D49 | 1 | 0 | |
|
||||||
|
SELECT pg_stat_monitor_reset() | 30 | 8 | DED7C3BDC91B9C6D | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1 FROM T | 55 | 8 | A2938DCD37EA0B53 | 1 | 0 | |
|
||||||
|
CREATE TABLE TBL_2_1(key text primary key, txt_0 | 92 | 8 | EB49AF77DF6ACE91 | 2 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 87 | 8 | AB3D91620522B027 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_4(key, txt_0, value_0) VALUES(' | 82 | 8 | 725801B5D3BF0FC7 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_5(key, txt_0, value_0, txt_1, v | 205 | 8 | DF620AAF2D68C1B9 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_4(key, txt_0, value_0, txt_1, v | 124 | 8 | DC3E349EB74C19E5 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1 FROM T | 55 | 8 | 2B56BD4846F0945A | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_2 SET value_0 = 233665123, value_1 = | 81 | 8 | 37B4252EA3D0ACD0 | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_2 SET value_0 = 336465782 | 38 | 8 | B3F9A1C4B84F1F6E | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_3(key, txt_0, value_0) VALUES(' | 83 | 8 | 3B74D31DC24049AE | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_1(key, txt_0, value_0, txt_1, v | 122 | 8 | E67C2A4876991361 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_5(key, txt_0, value_0) VALUES(' | 83 | 8 | 8AFE97DA5BA270F3 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_5(key, txt_0, value_0, txt_1, v | 287 | 8 | B86F5F013045BB35 | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_3 SET value_0 = 184803526, value_1 = | 59 | 8 | 481E62DF6E13F673 | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_3 SET value_0 = 137806862, value_1 = | 100 | 8 | 4826BD5A1850C3DB | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1 FROM T | 55 | 8 | 6F4658C0C4D476E4 | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_4 SET value_0 = 1843993368, value_1 | 82 | 8 | ED5B292A448E4E44 | 1 | 0 | |
|
||||||
|
CREATE TABLE TBL_2_2(key text primary key, txt_0 | 117 | 8 | 439CC4659745887A | 2 | 0 | |
|
||||||
|
INSERT INTO TBL_2_3(key, txt_0, value_0, txt_1, v | 166 | 8 | 578B4CBEC849C5AC | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_4(key, txt_0, value_0, txt_1, v | 164 | 8 | 38A7344ABD42E2D4 | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_3 SET value_0 = 1129566413 | 39 | 8 | 6D9B5FD9B3ECB930 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 71 | 8 | 2F9348F3E811B79A | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_3(key, txt_0, value_0, txt_1, v | 205 | 8 | 2D60780B6E5147F4 | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_4 SET value_0 = 855636226, value_1 = | 104 | 8 | 5FC4696DAD56E2EA | 1 | 0 | |
|
||||||
|
CREATE TABLE TBL_2_5(key text primary key, txt_0 | 192 | 8 | B3FA223A87014AE | 2 | 0 | |
|
||||||
|
INSERT INTO TBL_2_5(key, txt_0, value_0, txt_1, v | 245 | 8 | ED14C4FF5E930055 | 1 | 0 | |
|
||||||
|
CREATE TABLE TBL_2_3(key text primary key, txt_0 | 142 | 8 | F079ED304A17DBC5 | 2 | 0 | |
|
||||||
|
INSERT INTO TBL_2_4(key, txt_0, value_0, txt_1, v | 246 | 8 | C0C08BEE90320 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0 FROM TBL_2_5 | 39 | 8 | 82535261690FDE1D | 1 | 0 | |
|
||||||
|
SELECT * from pg_stat_monitor_settings | 38 | 8 | 1FC4A7E71F639F9D | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0 FROM TBL_2_2 | 39 | 8 | A4945C687430A780 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 87 | 8 | 3B37D99AD3D9106D | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 71 | 8 | 56787B092622E1F | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 103 | 8 | 2689FAB68E4D0D85 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_5(key, txt_0, value_0, txt_1, v | 123 | 8 | 78B7E1236DE48707 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0 FROM TBL_2_3 | 39 | 8 | 678DD130B42BE005 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_4(key, txt_0, value_0, txt_1, v | 206 | 8 | B282D8834F6C7796 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_2(key, txt_0, value_0, txt_1, v | 125 | 8 | 9CF25142A821A28A | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_0(key, txt_0, value_0) VALUES(' | 82 | 8 | 8697D20BA92E0E4F | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_3(key, txt_0, value_0, txt_1, v | 124 | 8 | C09694BDCD5115CB | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1 FROM T | 55 | 8 | 48162B33BC7640C3 | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_4 SET value_0 = 1264095060, value_1 | 61 | 8 | 867FF05B638DBE97 | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_1(key, txt_0, value_0) VALUES(' | 83 | 8 | 7E999BC11FAAB01D | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_1 SET value_0 = 1189641421 | 39 | 8 | 8EB080EC0FE7A841 | 1 | 0 | |
|
||||||
|
SELECT key, txt_0, value_0, txt_1, value_1, txt_2 | 71 | 8 | 8CF9F5BEF1F4EA82 | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_3 SET value_0 = 1424268980, value_1 | 82 | 8 | 3DF7E3F09F312E6C | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_4 SET value_0 = 2053999932 | 39 | 8 | 3681F525B0E1E277 | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_2 SET value_0 = 861021530, value_1 = | 59 | 8 | F24B049D9A1F87B6 | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_0 SET value_0 = 1681692777 | 39 | 8 | D17CA038032BEF1 | 1 | 0 | |
|
||||||
|
UPDATE TBL_2_4 SET value_0 = 1036140795, value_1 | 125 | 8 | 714EBA1E5D48D2F9 | 1 | 0 | |
|
||||||
|
CREATE TABLE TBL_2_0(key text primary key, txt_0 | 67 | 8 | 2FDDD5D4F3A6A2E5 | 2 | 0 | |
|
||||||
|
UPDATE TBL_2_1 SET value_0 = 1025202362, value_1 | 61 | 8 | 840DA100E65E11AB | 1 | 0 | |
|
||||||
|
INSERT INTO TBL_2_5(key, txt_0, value_0, txt_1, v | 162 | 8 | 73D7DCDC196DA935 | 1 | 0 | |
|
||||||
|
(63 rows)
|
||||||
|
|
||||||
|
SELECT count(queryid) from pg_stat_monitor;
|
||||||
|
count
|
||||||
|
-------
|
||||||
|
63
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
Drop extension pg_stat_monitor;
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue