Skip to content

Commit

Permalink
Fix flaky ordered append regression tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriziomello committed Feb 27, 2025
1 parent 9bd9786 commit a9ed3a6
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 41 deletions.
1 change: 1 addition & 0 deletions tsl/test/shared/expected/ordered_append-14.out
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ SELECT format('\! diff -u --label "Uncompressed results" --label "Compressed res
\set PREFIX_VERBOSE 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
set work_mem to '64MB';
set max_parallel_workers_per_gather to 0;
set enable_nestloop to off;
\set TEST_TABLE 'metrics'
\ir :TEST_QUERY_NAME
-- This file and its contents are licensed under the Timescale License.
Expand Down
1 change: 1 addition & 0 deletions tsl/test/shared/expected/ordered_append-15.out
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ SELECT format('\! diff -u --label "Uncompressed results" --label "Compressed res
\set PREFIX_VERBOSE 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
set work_mem to '64MB';
set max_parallel_workers_per_gather to 0;
set enable_nestloop to off;
\set TEST_TABLE 'metrics'
\ir :TEST_QUERY_NAME
-- This file and its contents are licensed under the Timescale License.
Expand Down
1 change: 1 addition & 0 deletions tsl/test/shared/expected/ordered_append-16.out
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ SELECT format('\! diff -u --label "Uncompressed results" --label "Compressed res
\set PREFIX_VERBOSE 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
set work_mem to '64MB';
set max_parallel_workers_per_gather to 0;
set enable_nestloop to off;
\set TEST_TABLE 'metrics'
\ir :TEST_QUERY_NAME
-- This file and its contents are licensed under the Timescale License.
Expand Down
1 change: 1 addition & 0 deletions tsl/test/shared/expected/ordered_append-17.out
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ SELECT format('\! diff -u --label "Uncompressed results" --label "Compressed res
\set PREFIX_VERBOSE 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
set work_mem to '64MB';
set max_parallel_workers_per_gather to 0;
set enable_nestloop to off;
\set TEST_TABLE 'metrics'
\ir :TEST_QUERY_NAME
-- This file and its contents are licensed under the Timescale License.
Expand Down
17 changes: 8 additions & 9 deletions tsl/test/shared/expected/ordered_append_join-14.out
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ SELECT format('\! diff -u --label "Uncompressed results" --label "Compressed res
\set PREFIX_VERBOSE 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
set work_mem to '64MB';
set max_parallel_workers_per_gather to 0;
set enable_nestloop to off;
\set TEST_TABLE 'metrics'
\ir :TEST_QUERY_NAME
-- This file and its contents are licensed under the Timescale License.
Expand Down Expand Up @@ -69,15 +70,13 @@ FROM (
QUERY PLAN
Nested Loop (actual rows=4 loops=1)
-> Values Scan on "*VALUES*" (actual rows=2 loops=1)
-> Materialize (actual rows=2 loops=2)
-> Subquery Scan on l (actual rows=2 loops=1)
-> Limit (actual rows=2 loops=1)
-> Custom Scan (ChunkAppend) on metrics (actual rows=2 loops=1)
Order: metrics."time" DESC
-> Index Scan using _hyper_X_X_chunk_metrics_time_idx on _hyper_X_X_chunk (actual rows=2 loops=1)
-> Index Scan using _hyper_X_X_chunk_metrics_time_idx on _hyper_X_X_chunk (never executed)
-> Index Scan using _hyper_X_X_chunk_metrics_time_idx on _hyper_X_X_chunk (never executed)
(10 rows)
-> Limit (actual rows=2 loops=2)
-> Custom Scan (ChunkAppend) on metrics (actual rows=2 loops=2)
Order: metrics."time" DESC
-> Index Scan using _hyper_X_X_chunk_metrics_time_idx on _hyper_X_X_chunk (actual rows=2 loops=2)
-> Index Scan using _hyper_X_X_chunk_metrics_time_idx on _hyper_X_X_chunk (never executed)
-> Index Scan using _hyper_X_X_chunk_metrics_time_idx on _hyper_X_X_chunk (never executed)
(8 rows)

-- test plan with best index is chosen
-- this should use device_id, time index
Expand Down
19 changes: 9 additions & 10 deletions tsl/test/shared/expected/ordered_append_join-15.out
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ SELECT format('\! diff -u --label "Uncompressed results" --label "Compressed res
\set PREFIX_VERBOSE 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
set work_mem to '64MB';
set max_parallel_workers_per_gather to 0;
set enable_nestloop to off;
\set TEST_TABLE 'metrics'
\ir :TEST_QUERY_NAME
-- This file and its contents are licensed under the Timescale License.
Expand Down Expand Up @@ -69,16 +70,14 @@ FROM (
QUERY PLAN
Nested Loop (actual rows=4 loops=1)
-> Values Scan on "*VALUES*" (actual rows=2 loops=1)
-> Materialize (actual rows=2 loops=2)
-> Subquery Scan on l (actual rows=2 loops=1)
-> Limit (actual rows=2 loops=1)
-> Result (actual rows=2 loops=1)
-> Custom Scan (ChunkAppend) on metrics (actual rows=2 loops=1)
Order: metrics."time" DESC
-> Index Scan using _hyper_X_X_chunk_metrics_time_idx on _hyper_X_X_chunk (actual rows=2 loops=1)
-> Index Scan using _hyper_X_X_chunk_metrics_time_idx on _hyper_X_X_chunk (never executed)
-> Index Scan using _hyper_X_X_chunk_metrics_time_idx on _hyper_X_X_chunk (never executed)
(11 rows)
-> Limit (actual rows=2 loops=2)
-> Result (actual rows=2 loops=2)
-> Custom Scan (ChunkAppend) on metrics (actual rows=2 loops=2)
Order: metrics."time" DESC
-> Index Scan using _hyper_X_X_chunk_metrics_time_idx on _hyper_X_X_chunk (actual rows=2 loops=2)
-> Index Scan using _hyper_X_X_chunk_metrics_time_idx on _hyper_X_X_chunk (never executed)
-> Index Scan using _hyper_X_X_chunk_metrics_time_idx on _hyper_X_X_chunk (never executed)
(9 rows)

-- test plan with best index is chosen
-- this should use device_id, time index
Expand Down
19 changes: 9 additions & 10 deletions tsl/test/shared/expected/ordered_append_join-16.out
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ SELECT format('\! diff -u --label "Uncompressed results" --label "Compressed res
\set PREFIX_VERBOSE 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
set work_mem to '64MB';
set max_parallel_workers_per_gather to 0;
set enable_nestloop to off;
\set TEST_TABLE 'metrics'
\ir :TEST_QUERY_NAME
-- This file and its contents are licensed under the Timescale License.
Expand Down Expand Up @@ -69,16 +70,14 @@ FROM (
QUERY PLAN
Nested Loop (actual rows=4 loops=1)
-> Values Scan on "*VALUES*" (actual rows=2 loops=1)
-> Materialize (actual rows=2 loops=2)
-> Subquery Scan on l (actual rows=2 loops=1)
-> Limit (actual rows=2 loops=1)
-> Result (actual rows=2 loops=1)
-> Custom Scan (ChunkAppend) on metrics (actual rows=2 loops=1)
Order: metrics."time" DESC
-> Index Scan using _hyper_X_X_chunk_metrics_time_idx on _hyper_X_X_chunk (actual rows=2 loops=1)
-> Index Scan using _hyper_X_X_chunk_metrics_time_idx on _hyper_X_X_chunk (never executed)
-> Index Scan using _hyper_X_X_chunk_metrics_time_idx on _hyper_X_X_chunk (never executed)
(11 rows)
-> Limit (actual rows=2 loops=2)
-> Result (actual rows=2 loops=2)
-> Custom Scan (ChunkAppend) on metrics (actual rows=2 loops=2)
Order: metrics."time" DESC
-> Index Scan using _hyper_X_X_chunk_metrics_time_idx on _hyper_X_X_chunk (actual rows=2 loops=2)
-> Index Scan using _hyper_X_X_chunk_metrics_time_idx on _hyper_X_X_chunk (never executed)
-> Index Scan using _hyper_X_X_chunk_metrics_time_idx on _hyper_X_X_chunk (never executed)
(9 rows)

-- test plan with best index is chosen
-- this should use device_id, time index
Expand Down
19 changes: 9 additions & 10 deletions tsl/test/shared/expected/ordered_append_join-17.out
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ SELECT format('\! diff -u --label "Uncompressed results" --label "Compressed res
\set PREFIX_VERBOSE 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
set work_mem to '64MB';
set max_parallel_workers_per_gather to 0;
set enable_nestloop to off;
\set TEST_TABLE 'metrics'
\ir :TEST_QUERY_NAME
-- This file and its contents are licensed under the Timescale License.
Expand Down Expand Up @@ -69,16 +70,14 @@ FROM (
QUERY PLAN
Nested Loop (actual rows=4 loops=1)
-> Values Scan on "*VALUES*" (actual rows=2 loops=1)
-> Materialize (actual rows=2 loops=2)
-> Subquery Scan on l (actual rows=2 loops=1)
-> Limit (actual rows=2 loops=1)
-> Result (actual rows=2 loops=1)
-> Custom Scan (ChunkAppend) on metrics (actual rows=2 loops=1)
Order: metrics."time" DESC
-> Index Scan using _hyper_X_X_chunk_metrics_time_idx on _hyper_X_X_chunk (actual rows=2 loops=1)
-> Index Scan using _hyper_X_X_chunk_metrics_time_idx on _hyper_X_X_chunk (never executed)
-> Index Scan using _hyper_X_X_chunk_metrics_time_idx on _hyper_X_X_chunk (never executed)
(11 rows)
-> Limit (actual rows=2 loops=2)
-> Result (actual rows=2 loops=2)
-> Custom Scan (ChunkAppend) on metrics (actual rows=2 loops=2)
Order: metrics."time" DESC
-> Index Scan using _hyper_X_X_chunk_metrics_time_idx on _hyper_X_X_chunk (actual rows=2 loops=2)
-> Index Scan using _hyper_X_X_chunk_metrics_time_idx on _hyper_X_X_chunk (never executed)
-> Index Scan using _hyper_X_X_chunk_metrics_time_idx on _hyper_X_X_chunk (never executed)
(9 rows)

-- test plan with best index is chosen
-- this should use device_id, time index
Expand Down
5 changes: 4 additions & 1 deletion tsl/test/shared/sql/ordered_append.sql.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ SELECT format('\! diff -u --label "Uncompressed results" --label "Compressed res
\set PREFIX_VERBOSE 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'

set work_mem to '64MB';

set max_parallel_workers_per_gather to 0;
set enable_nestloop to off;

\set TEST_TABLE 'metrics'
\ir :TEST_QUERY_NAME
\set TEST_TABLE 'metrics_space'
Expand Down Expand Up @@ -57,3 +58,5 @@ SET client_min_messages TO error;

-- diff compressed and uncompressed results
:DIFF_CMD

reset enable_nestloop;
4 changes: 3 additions & 1 deletion tsl/test/shared/sql/ordered_append_join.sql.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ SELECT format('\! diff -u --label "Uncompressed results" --label "Compressed res
\set PREFIX_VERBOSE 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'

set work_mem to '64MB';

set max_parallel_workers_per_gather to 0;
set enable_nestloop to off;

\set TEST_TABLE 'metrics'
\ir :TEST_QUERY_NAME
\set TEST_TABLE 'metrics_space'
Expand Down Expand Up @@ -85,3 +86,4 @@ GROUP BY 1 ORDER BY 1;
DROP TABLE i4418_1;
DROP TABLE i4418_2;

reset enable_nestloop;

0 comments on commit a9ed3a6

Please sign in to comment.