\echo '========================================='
\echo 'Test 1: track=''none'' (CLEAN BASELINE)'
\echo '========================================='
ALTER SYSTEM SET pg_stat_statements.track = 'none';
SELECT pg_reload_conf();
SELECT pg_sleep(1);
\echo 'Warmup...'
DO $$ BEGIN FOR i IN 1..10000 LOOP PERFORM 1; END LOOP; END $$;
SELECT pg_sleep(1);
\echo ''
\echo 'Run 1:'
\timing on
DO $$ BEGIN FOR i IN 1..1000000 LOOP PERFORM 1; END LOOP; END $$;
\timing off
SELECT pg_sleep(1);
\echo ''
\echo 'Run 2:'
\timing on
DO $$ BEGIN FOR i IN 1..1000000 LOOP PERFORM 1; END LOOP; END $$;
\timing off
SELECT pg_sleep(1);
\echo ''
\echo 'Run 3:'
\timing on
DO $$ BEGIN FOR i IN 1..1000000 LOOP PERFORM 1; END LOOP; END $$;
\timing off
SELECT pg_sleep(2);
\echo ''

\echo '========================================='
\echo 'Test 2: track=''all'' (WITH TRACKING)'
\echo '========================================='
ALTER SYSTEM SET pg_stat_statements.track = 'all';
SELECT pg_reload_conf();
SELECT pg_sleep(1);
SELECT pg_stat_statements_reset();
\echo 'Warmup...'
DO $$ BEGIN FOR i IN 1..10000 LOOP PERFORM 1; END LOOP; END $$;
SELECT pg_sleep(1);
\echo ''
\echo 'Run 1:'
\timing on
DO $$ BEGIN FOR i IN 1..1000000 LOOP PERFORM 1; END LOOP; END $$;
\timing off
SELECT pg_sleep(1);
\echo ''
\echo 'Run 2:'
\timing on
DO $$ BEGIN FOR i IN 1..1000000 LOOP PERFORM 1; END LOOP; END $$;
\timing off
SELECT pg_sleep(1);
\echo ''
\echo 'Run 3:'
\timing on
DO $$ BEGIN FOR i IN 1..1000000 LOOP PERFORM 1; END LOOP; END $$;
\timing off

