Skip to content

Commit

Permalink
Fixed transparent decompress chunk
Browse files Browse the repository at this point in the history
Transparent decompress chunk was added into to ignore list due to
the side effect of timescale#5118. This issue is to fix the flaky nature of
the test.
  • Loading branch information
shhnwz committed Apr 17, 2023
1 parent 90e54de commit 12b2ee0
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 74 deletions.
6 changes: 3 additions & 3 deletions .github/gh_matrix_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ def macos_config(overrides):
pg15_installcheck_args = "IGNORES='partialize_finalize transparent_decompress_chunk-15'"

# transparent_decompress_chunk-[12,13,14] is ignored due to #5118
pg14_installcheck_args = "IGNORES='bgw_db_scheduler bgw_db_scheduler_fixed partialize_finalize transparent_decompress_chunk-14'"
pg14_installcheck_args = "IGNORES='partialize_finalize'"

pg13_installcheck_args = "IGNORES='bgw_db_scheduler bgw_db_scheduler_fixed partialize_finalize transparent_decompress_chunk-13'"
pg13_installcheck_args = "IGNORES='partialize_finalize'"

pg12_installcheck_args = "IGNORES='bgw_db_scheduler bgw_db_scheduler_fixed partialize_finalize transparent_decompress_chunk-12'"
pg12_installcheck_args = "IGNORES='partialize_finalize'"

# always test debug build on latest of all supported pg versions
m["include"].append(
Expand Down
37 changes: 16 additions & 21 deletions tsl/test/shared/expected/transparent_decompress_chunk-12.out
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ QUERY PLAN
(4 rows)

DROP VIEW compressed_view;
SET parallel_leader_participation TO OFF;
-- test INNER JOIN
:PREFIX
SELECT *
Expand Down Expand Up @@ -808,28 +809,22 @@ ORDER BY m1.time,
LIMIT 100;
QUERY PLAN
Limit (actual rows=100 loops=1)
-> Gather Merge (actual rows=100 loops=1)
Workers Planned: 1
Workers Launched: 1
-> Sort (actual rows=90 loops=2)
Sort Key: m1."time", m1.device_id, m2."time", m2.device_id
Sort Method: top-N heapsort
Worker 0: Sort Method: top-N heapsort
-> Parallel Hash Left Join (actual rows=8995 loops=2)
Hash Cond: (m1."time" = m2."time")
Join Filter: (m1.device_id = 1)
Rows Removed by Join Filter: 7196
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m1 (actual rows=8995 loops=2)
-> Parallel Seq Scan on compress_hyper_X_X_chunk (actual rows=10 loops=2)
-> Parallel Hash (actual rows=1799 loops=2)
Buckets: 4096 (originally 2048) Batches: 1 (originally 1)
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m2 (actual rows=3598 loops=1)
-> Parallel Seq Scan on compress_hyper_X_X_chunk compress_hyper_X_X_chunk_1 (actual rows=4 loops=1)
Filter: (device_id = 2)
Rows Removed by Filter: 16
(20 rows)
-> Sort (actual rows=100 loops=1)
Sort Key: m1."time", m1.device_id, m2."time", m2.device_id
Sort Method: top-N heapsort
-> Hash Left Join (actual rows=17990 loops=1)
Hash Cond: (m1."time" = m2."time")
Join Filter: (m1.device_id = 1)
Rows Removed by Join Filter: 14392
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m1 (actual rows=17990 loops=1)
-> Seq Scan on compress_hyper_X_X_chunk (actual rows=20 loops=1)
-> Hash (actual rows=3598 loops=1)
Buckets: 4096 (originally 1024) Batches: 1 (originally 1)
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m2 (actual rows=3598 loops=1)
-> Index Scan using compress_hyper_X_X_chunk__compressed_hypertable_4_device_id__t on compress_hyper_X_X_chunk compress_hyper_X_X_chunk_1 (actual rows=4 loops=1)
Index Cond: (device_id = 2)
(15 rows)

SET parallel_leader_participation TO false;
-- test implicit self-join
:PREFIX
SELECT *
Expand Down
29 changes: 13 additions & 16 deletions tsl/test/shared/expected/transparent_decompress_chunk-13.out
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,7 @@ QUERY PLAN
(4 rows)

DROP VIEW compressed_view;
SET parallel_leader_participation TO OFF;
-- test INNER JOIN
:PREFIX
SELECT *
Expand All @@ -674,15 +675,14 @@ QUERY PLAN
-> Gather Merge (actual rows=10 loops=1)
Workers Planned: 1
Workers Launched: 1
-> Sort (actual rows=5 loops=2)
-> Sort (actual rows=1025 loops=1)
Sort Key: m1."time", m1.device_id
Sort Method: quicksort
Worker 0: Sort Method: quicksort
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m1 (actual rows=8995 loops=2)
-> Parallel Seq Scan on compress_hyper_X_X_chunk (actual rows=10 loops=2)
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m1 (actual rows=17990 loops=1)
-> Parallel Seq Scan on compress_hyper_X_X_chunk (actual rows=20 loops=1)
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m2 (actual rows=17990 loops=10)
-> Seq Scan on compress_hyper_X_X_chunk compress_hyper_X_X_chunk_1 (actual rows=20 loops=10)
(15 rows)
(14 rows)

:PREFIX
SELECT *
Expand All @@ -705,18 +705,17 @@ QUERY PLAN
-> Gather Merge (actual rows=10 loops=1)
Workers Planned: 1
Workers Launched: 1
-> Sort (actual rows=5 loops=2)
-> Sort (actual rows=1025 loops=1)
Sort Key: m1."time", m1.device_id
Sort Method: quicksort
Worker 0: Sort Method: quicksort
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m1 (actual rows=8995 loops=2)
-> Parallel Seq Scan on compress_hyper_X_X_chunk (actual rows=10 loops=2)
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m1 (actual rows=17990 loops=1)
-> Parallel Seq Scan on compress_hyper_X_X_chunk (actual rows=20 loops=1)
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m2 (actual rows=17990 loops=10)
-> Seq Scan on compress_hyper_X_X_chunk compress_hyper_X_X_chunk_1 (actual rows=20 loops=10)
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m3 (actual rows=3598 loops=10)
-> Index Scan using compress_hyper_X_X_chunk__compressed_hypertable_4_device_id__t on compress_hyper_X_X_chunk compress_hyper_X_X_chunk_2 (actual rows=4 loops=10)
Index Cond: (device_id = 3)
(21 rows)
(20 rows)

:PREFIX
SELECT *
Expand Down Expand Up @@ -793,15 +792,14 @@ QUERY PLAN
-> Gather Merge (actual rows=10 loops=1)
Workers Planned: 1
Workers Launched: 1
-> Sort (actual rows=5 loops=2)
-> Sort (actual rows=1025 loops=1)
Sort Key: m1."time", m1.device_id
Sort Method: quicksort
Worker 0: Sort Method: quicksort
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m1 (actual rows=8995 loops=2)
-> Parallel Seq Scan on compress_hyper_X_X_chunk (actual rows=10 loops=2)
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m1 (actual rows=17990 loops=1)
-> Parallel Seq Scan on compress_hyper_X_X_chunk (actual rows=20 loops=1)
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m2 (actual rows=17990 loops=10)
-> Seq Scan on compress_hyper_X_X_chunk compress_hyper_X_X_chunk_1 (actual rows=20 loops=10)
(15 rows)
(14 rows)

:PREFIX
SELECT *
Expand Down Expand Up @@ -837,7 +835,6 @@ QUERY PLAN
Index Cond: (device_id = 2)
(20 rows)

SET parallel_leader_participation TO false;
-- test implicit self-join
:PREFIX
SELECT *
Expand Down
29 changes: 13 additions & 16 deletions tsl/test/shared/expected/transparent_decompress_chunk-14.out
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,7 @@ QUERY PLAN
(4 rows)

DROP VIEW compressed_view;
SET parallel_leader_participation TO OFF;
-- test INNER JOIN
:PREFIX
SELECT *
Expand All @@ -674,15 +675,14 @@ QUERY PLAN
-> Gather Merge (actual rows=10 loops=1)
Workers Planned: 1
Workers Launched: 1
-> Sort (actual rows=5 loops=2)
-> Sort (actual rows=1171 loops=1)
Sort Key: m1."time", m1.device_id
Sort Method: quicksort
Worker 0: Sort Method: quicksort
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m1 (actual rows=8995 loops=2)
-> Parallel Seq Scan on compress_hyper_X_X_chunk (actual rows=10 loops=2)
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m1 (actual rows=17990 loops=1)
-> Parallel Seq Scan on compress_hyper_X_X_chunk (actual rows=20 loops=1)
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m2 (actual rows=17990 loops=10)
-> Seq Scan on compress_hyper_X_X_chunk compress_hyper_X_X_chunk_1 (actual rows=20 loops=10)
(15 rows)
(14 rows)

:PREFIX
SELECT *
Expand All @@ -705,18 +705,17 @@ QUERY PLAN
-> Gather Merge (actual rows=10 loops=1)
Workers Planned: 1
Workers Launched: 1
-> Sort (actual rows=5 loops=2)
-> Sort (actual rows=1171 loops=1)
Sort Key: m1."time", m1.device_id
Sort Method: quicksort
Worker 0: Sort Method: quicksort
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m1 (actual rows=8995 loops=2)
-> Parallel Seq Scan on compress_hyper_X_X_chunk (actual rows=10 loops=2)
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m1 (actual rows=17990 loops=1)
-> Parallel Seq Scan on compress_hyper_X_X_chunk (actual rows=20 loops=1)
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m2 (actual rows=17990 loops=10)
-> Seq Scan on compress_hyper_X_X_chunk compress_hyper_X_X_chunk_1 (actual rows=20 loops=10)
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m3 (actual rows=3598 loops=10)
-> Index Scan using compress_hyper_X_X_chunk__compressed_hypertable_4_device_id__t on compress_hyper_X_X_chunk compress_hyper_X_X_chunk_2 (actual rows=4 loops=10)
Index Cond: (device_id = 3)
(21 rows)
(20 rows)

:PREFIX
SELECT *
Expand Down Expand Up @@ -793,15 +792,14 @@ QUERY PLAN
-> Gather Merge (actual rows=10 loops=1)
Workers Planned: 1
Workers Launched: 1
-> Sort (actual rows=5 loops=2)
-> Sort (actual rows=1171 loops=1)
Sort Key: m1."time", m1.device_id
Sort Method: quicksort
Worker 0: Sort Method: quicksort
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m1 (actual rows=8995 loops=2)
-> Parallel Seq Scan on compress_hyper_X_X_chunk (actual rows=10 loops=2)
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m1 (actual rows=17990 loops=1)
-> Parallel Seq Scan on compress_hyper_X_X_chunk (actual rows=20 loops=1)
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m2 (actual rows=17990 loops=10)
-> Seq Scan on compress_hyper_X_X_chunk compress_hyper_X_X_chunk_1 (actual rows=20 loops=10)
(15 rows)
(14 rows)

:PREFIX
SELECT *
Expand Down Expand Up @@ -837,7 +835,6 @@ QUERY PLAN
Index Cond: (device_id = 2)
(20 rows)

SET parallel_leader_participation TO false;
-- test implicit self-join
:PREFIX
SELECT *
Expand Down
29 changes: 13 additions & 16 deletions tsl/test/shared/expected/transparent_decompress_chunk-15.out
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,7 @@ QUERY PLAN
(4 rows)

DROP VIEW compressed_view;
SET parallel_leader_participation TO OFF;
-- test INNER JOIN
:PREFIX
SELECT *
Expand All @@ -676,15 +677,14 @@ QUERY PLAN
-> Gather Merge (actual rows=10 loops=1)
Workers Planned: 1
Workers Launched: 1
-> Sort (actual rows=5 loops=2)
-> Sort (actual rows=1170 loops=1)
Sort Key: m1."time", m1.device_id
Sort Method: quicksort
Worker 0: Sort Method: quicksort
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m1 (actual rows=8995 loops=2)
-> Parallel Seq Scan on compress_hyper_X_X_chunk (actual rows=10 loops=2)
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m1 (actual rows=17990 loops=1)
-> Parallel Seq Scan on compress_hyper_X_X_chunk (actual rows=20 loops=1)
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m2 (actual rows=17990 loops=10)
-> Seq Scan on compress_hyper_X_X_chunk compress_hyper_X_X_chunk_1 (actual rows=20 loops=10)
(15 rows)
(14 rows)

:PREFIX
SELECT *
Expand All @@ -707,18 +707,17 @@ QUERY PLAN
-> Gather Merge (actual rows=10 loops=1)
Workers Planned: 1
Workers Launched: 1
-> Sort (actual rows=5 loops=2)
-> Sort (actual rows=1170 loops=1)
Sort Key: m1."time", m1.device_id
Sort Method: quicksort
Worker 0: Sort Method: quicksort
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m1 (actual rows=8995 loops=2)
-> Parallel Seq Scan on compress_hyper_X_X_chunk (actual rows=10 loops=2)
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m1 (actual rows=17990 loops=1)
-> Parallel Seq Scan on compress_hyper_X_X_chunk (actual rows=20 loops=1)
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m2 (actual rows=17990 loops=10)
-> Seq Scan on compress_hyper_X_X_chunk compress_hyper_X_X_chunk_1 (actual rows=20 loops=10)
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m3 (actual rows=3598 loops=10)
-> Index Scan using compress_hyper_X_X_chunk__compressed_hypertable_4_device_id__t on compress_hyper_X_X_chunk compress_hyper_X_X_chunk_2 (actual rows=4 loops=10)
Index Cond: (device_id = 3)
(21 rows)
(20 rows)

:PREFIX
SELECT *
Expand Down Expand Up @@ -795,15 +794,14 @@ QUERY PLAN
-> Gather Merge (actual rows=10 loops=1)
Workers Planned: 1
Workers Launched: 1
-> Sort (actual rows=5 loops=2)
-> Sort (actual rows=1170 loops=1)
Sort Key: m1."time", m1.device_id
Sort Method: quicksort
Worker 0: Sort Method: quicksort
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m1 (actual rows=8995 loops=2)
-> Parallel Seq Scan on compress_hyper_X_X_chunk (actual rows=10 loops=2)
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m1 (actual rows=17990 loops=1)
-> Parallel Seq Scan on compress_hyper_X_X_chunk (actual rows=20 loops=1)
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m2 (actual rows=17990 loops=10)
-> Seq Scan on compress_hyper_X_X_chunk compress_hyper_X_X_chunk_1 (actual rows=20 loops=10)
(15 rows)
(14 rows)

:PREFIX
SELECT *
Expand Down Expand Up @@ -839,7 +837,6 @@ QUERY PLAN
Index Cond: (device_id = 2)
(20 rows)

SET parallel_leader_participation TO false;
-- test implicit self-join
:PREFIX
SELECT *
Expand Down
3 changes: 1 addition & 2 deletions tsl/test/shared/sql/transparent_decompress_chunk.sql.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
-- This file and its contents are licensed under the Timescale License.
-- Please see the included NOTICE for copyright information and
-- LICENSE-TIMESCALE for a copy of the license.

\set PREFIX 'EXPLAIN (analyze, costs off, timing off, summary off)'
\set PREFIX_VERBOSE 'EXPLAIN (analyze, costs off, timing off, summary off, verbose)'
\set PREFIX_NO_ANALYZE 'EXPLAIN (verbose, costs off)'
Expand Down Expand Up @@ -186,6 +185,7 @@ CREATE OR REPLACE VIEW compressed_view AS SELECT time, device_id, v1, v2 FROM :T

DROP VIEW compressed_view;

SET parallel_leader_participation TO OFF;
-- test INNER JOIN
:PREFIX
SELECT *
Expand Down Expand Up @@ -253,7 +253,6 @@ ORDER BY m1.time,
m2.device_id
LIMIT 100;

SET parallel_leader_participation TO false;
-- test implicit self-join
:PREFIX
SELECT *
Expand Down

0 comments on commit 12b2ee0

Please sign in to comment.