PG-338: Fix counters regression test.
After fixing the problem with utility statements, this whole block: 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 $$; Is only processed once, as those are nested statements, in order to match the 1000 statements the GUC pg_stat_monitor.track must be set to 'all' and then back to the default of 'top' when done testing it.pull/188/head
parent
79e0a86e4b
commit
a716273f19
|
@ -43,9 +43,16 @@ SELECT query,calls FROM pg_stat_monitor ORDER BY query COLLATE "C";
|
|||
SELECT query,calls FROM pg_stat_monitor ORDER BY query COLLATE "C" | 1
|
||||
(3 rows)
|
||||
|
||||
SELECT pg_stat_monitor_reset();
|
||||
pg_stat_monitor_reset
|
||||
-----------------------
|
||||
ALTER SYSTEM SET pg_stat_monitor.track TO 'all';
|
||||
SELECT pg_reload_conf();
|
||||
pg_reload_conf
|
||||
----------------
|
||||
t
|
||||
(1 row)
|
||||
|
||||
SELECT pg_sleep(1);
|
||||
pg_sleep
|
||||
----------
|
||||
|
||||
(1 row)
|
||||
|
||||
|
@ -83,6 +90,19 @@ SELECT query,calls FROM pg_stat_monitor ORDER BY query COLLATE "C";
|
|||
end $$ |
|
||||
(4 rows)
|
||||
|
||||
ALTER SYSTEM SET pg_stat_monitor.track TO 'top';
|
||||
SELECT pg_reload_conf();
|
||||
pg_reload_conf
|
||||
----------------
|
||||
t
|
||||
(1 row)
|
||||
|
||||
SELECT pg_sleep(1);
|
||||
pg_sleep
|
||||
----------
|
||||
|
||||
(1 row)
|
||||
|
||||
SELECT pg_stat_monitor_reset();
|
||||
pg_stat_monitor_reset
|
||||
-----------------------
|
||||
|
|
|
@ -12,9 +12,12 @@ SELECT a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a;
|
|||
SELECT a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a;
|
||||
SELECT a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a;
|
||||
SELECT query,calls FROM pg_stat_monitor ORDER BY query COLLATE "C";
|
||||
|
||||
ALTER SYSTEM SET pg_stat_monitor.track TO 'all';
|
||||
SELECT pg_reload_conf();
|
||||
SELECT pg_sleep(1);
|
||||
SELECT pg_stat_monitor_reset();
|
||||
|
||||
SELECT pg_stat_monitor_reset();
|
||||
do $$
|
||||
declare
|
||||
n integer:= 1;
|
||||
|
@ -26,6 +29,10 @@ begin
|
|||
end loop;
|
||||
end $$;
|
||||
SELECT query,calls FROM pg_stat_monitor ORDER BY query COLLATE "C";
|
||||
|
||||
ALTER SYSTEM SET pg_stat_monitor.track TO 'top';
|
||||
SELECT pg_reload_conf();
|
||||
SELECT pg_sleep(1);
|
||||
SELECT pg_stat_monitor_reset();
|
||||
|
||||
DROP TABLE t1;
|
||||
|
|
Loading…
Reference in New Issue