Parsed test spec with 3 sessions starting permutation: s3_reference s1_aggs s3_parked s2_abort s3_release injection_points_attach ----------------------- (1 row) s3: NOTICE: aggregates over keys planned: t step s3_reference: DO $$ DECLARE ln text; found bool := false; BEGIN SET LOCAL enable_seqscan = off; FOR ln IN EXPLAIN (COSTS OFF) SELECT sum(100 / k), min(1000 / k), max(k) FROM wz LOOP IF ln ~ 'Aggregates Over Keys' THEN found := true; END IF; END LOOP; RAISE NOTICE 'aggregates over keys planned: %', found; END $$; SET pg_lion.enable_count_pushdown = off; SELECT sum(100 / k), min(1000 / k), max(k) FROM wz; RESET pg_lion.enable_count_pushdown; sum|min| max ---+---+---- 964| 0|5000 (1 row) step s1_aggs: SELECT sum(100 / k), min(1000 / k), max(k) FROM wz; step s3_parked: SELECT wait_event FROM pg_stat_activity WHERE datname = current_database() AND wait_event_type = 'InjectionPoint'; wait_event ---------------- lion-wagg-looked (1 row) step s2_abort: BEGIN; INSERT INTO wz VALUES (0); ROLLBACK; step s3_release: SELECT injection_points_detach('lion-wagg-looked'); SELECT injection_points_wakeup('lion-wagg-looked'); /* * Wait until s1 has left the point. The tester deems a session that * waits at one blocked, and checks the walk again as soon as this step * is done: seen there still, the walk's answer would be reported after * the next step's instead of before it. */ DO $$ BEGIN FOR i IN 1 .. 6000 LOOP PERFORM pg_stat_clear_snapshot(); EXIT WHEN NOT EXISTS (SELECT FROM pg_stat_activity WHERE datname = current_database() AND wait_event_type = 'InjectionPoint' AND wait_event = 'lion-wagg-looked'); PERFORM pg_sleep(0.01); END LOOP; END $$; injection_points_detach ----------------------- (1 row) injection_points_wakeup ----------------------- (1 row) step s1_aggs: <... completed> sum|min| max ---+---+---- 964| 0|5000 (1 row) starting permutation: s3_reference s1_aggs s3_parked s2_commit s3_release injection_points_attach ----------------------- (1 row) s3: NOTICE: aggregates over keys planned: t step s3_reference: DO $$ DECLARE ln text; found bool := false; BEGIN SET LOCAL enable_seqscan = off; FOR ln IN EXPLAIN (COSTS OFF) SELECT sum(100 / k), min(1000 / k), max(k) FROM wz LOOP IF ln ~ 'Aggregates Over Keys' THEN found := true; END IF; END LOOP; RAISE NOTICE 'aggregates over keys planned: %', found; END $$; SET pg_lion.enable_count_pushdown = off; SELECT sum(100 / k), min(1000 / k), max(k) FROM wz; RESET pg_lion.enable_count_pushdown; sum|min| max ---+---+---- 964| 0|5000 (1 row) step s1_aggs: SELECT sum(100 / k), min(1000 / k), max(k) FROM wz; step s3_parked: SELECT wait_event FROM pg_stat_activity WHERE datname = current_database() AND wait_event_type = 'InjectionPoint'; wait_event ---------------- lion-wagg-looked (1 row) step s2_commit: INSERT INTO wz VALUES (0); step s3_release: SELECT injection_points_detach('lion-wagg-looked'); SELECT injection_points_wakeup('lion-wagg-looked'); /* * Wait until s1 has left the point. The tester deems a session that * waits at one blocked, and checks the walk again as soon as this step * is done: seen there still, the walk's answer would be reported after * the next step's instead of before it. */ DO $$ BEGIN FOR i IN 1 .. 6000 LOOP PERFORM pg_stat_clear_snapshot(); EXIT WHEN NOT EXISTS (SELECT FROM pg_stat_activity WHERE datname = current_database() AND wait_event_type = 'InjectionPoint' AND wait_event = 'lion-wagg-looked'); PERFORM pg_sleep(0.01); END LOOP; END $$; injection_points_detach ----------------------- (1 row) injection_points_wakeup ----------------------- (1 row) step s1_aggs: <... completed> sum|min| max ---+---+---- 964| 0|5000 (1 row) starting permutation: s3_reference s1_small s1_aggs s3_parked s2_abort s3_release injection_points_attach ----------------------- (1 row) s3: NOTICE: aggregates over keys planned: t step s3_reference: DO $$ DECLARE ln text; found bool := false; BEGIN SET LOCAL enable_seqscan = off; FOR ln IN EXPLAIN (COSTS OFF) SELECT sum(100 / k), min(1000 / k), max(k) FROM wz LOOP IF ln ~ 'Aggregates Over Keys' THEN found := true; END IF; END LOOP; RAISE NOTICE 'aggregates over keys planned: %', found; END $$; SET pg_lion.enable_count_pushdown = off; SELECT sum(100 / k), min(1000 / k), max(k) FROM wz; RESET pg_lion.enable_count_pushdown; sum|min| max ---+---+---- 964| 0|5000 (1 row) step s1_small: SET work_mem = 64; step s1_aggs: SELECT sum(100 / k), min(1000 / k), max(k) FROM wz; step s3_parked: SELECT wait_event FROM pg_stat_activity WHERE datname = current_database() AND wait_event_type = 'InjectionPoint'; wait_event ---------------- lion-wagg-looked (1 row) step s2_abort: BEGIN; INSERT INTO wz VALUES (0); ROLLBACK; step s3_release: SELECT injection_points_detach('lion-wagg-looked'); SELECT injection_points_wakeup('lion-wagg-looked'); /* * Wait until s1 has left the point. The tester deems a session that * waits at one blocked, and checks the walk again as soon as this step * is done: seen there still, the walk's answer would be reported after * the next step's instead of before it. */ DO $$ BEGIN FOR i IN 1 .. 6000 LOOP PERFORM pg_stat_clear_snapshot(); EXIT WHEN NOT EXISTS (SELECT FROM pg_stat_activity WHERE datname = current_database() AND wait_event_type = 'InjectionPoint' AND wait_event = 'lion-wagg-looked'); PERFORM pg_sleep(0.01); END LOOP; END $$; injection_points_detach ----------------------- (1 row) injection_points_wakeup ----------------------- (1 row) step s1_aggs: <... completed> sum|min| max ---+---+---- 964| 0|5000 (1 row)