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/175/head
parent
2c14e1dc08
commit
52fb1fbc7d
|
@ -42,9 +42,16 @@ SELECT query,calls FROM pg_stat_monitor ORDER BY query COLLATE "C";
|
||||||
SELECT pg_stat_monitor_reset() | 1
|
SELECT pg_stat_monitor_reset() | 1
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
||||||
SELECT pg_stat_monitor_reset();
|
ALTER SYSTEM SET pg_stat_monitor.track TO 'all';
|
||||||
pg_stat_monitor_reset
|
SELECT pg_reload_conf();
|
||||||
-----------------------
|
pg_reload_conf
|
||||||
|
----------------
|
||||||
|
t
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
SELECT pg_sleep(1);
|
||||||
|
pg_sleep
|
||||||
|
----------
|
||||||
|
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
|
@ -81,6 +88,19 @@ SELECT query,calls FROM pg_stat_monitor ORDER BY query COLLATE "C";
|
||||||
end $$ |
|
end $$ |
|
||||||
(3 rows)
|
(3 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();
|
SELECT pg_stat_monitor_reset();
|
||||||
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 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";
|
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();
|
||||||
|
|
||||||
SELECT pg_stat_monitor_reset();
|
|
||||||
do $$
|
do $$
|
||||||
declare
|
declare
|
||||||
n integer:= 1;
|
n integer:= 1;
|
||||||
|
@ -26,6 +29,10 @@ begin
|
||||||
end loop;
|
end loop;
|
||||||
end $$;
|
end $$;
|
||||||
SELECT query,calls FROM pg_stat_monitor ORDER BY query COLLATE "C";
|
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();
|
SELECT pg_stat_monitor_reset();
|
||||||
|
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
Loading…
Reference in New Issue