Skip to content

Commit

Permalink
reference REL_16_4-111-g925b3aa857 cagg_union_view-* continuous_aggs-…
Browse files Browse the repository at this point in the history
…* transparent_decompression-*
  • Loading branch information
akuzm committed Dec 5, 2024
1 parent 11b1db5 commit f9186ea
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 62 deletions.
68 changes: 32 additions & 36 deletions tsl/test/expected/cagg_union_view-16.out
Original file line number Diff line number Diff line change
Expand Up @@ -355,31 +355,29 @@ SELECT _timescaledb_functions.cagg_watermark(:boundary_view_id);

-- first UNION child should have no rows because no materialization has happened yet and 2nd child should have 4 rows
:PREFIX SELECT * FROM boundary_view;
QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------------------
QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------------
Finalize GroupAggregate (actual rows=4 loops=1)
Group Key: (time_bucket(10, _hyper_5_5_chunk."time"))
-> Sort (actual rows=4 loops=1)
-> Merge Append (actual rows=4 loops=1)
Sort Key: (time_bucket(10, _hyper_5_5_chunk."time"))
Sort Method: quicksort
-> Append (actual rows=4 loops=1)
-> Partial GroupAggregate (actual rows=1 loops=1)
Group Key: time_bucket(10, _hyper_5_5_chunk."time")
-> Index Scan Backward using _hyper_5_5_chunk_boundary_test_time_idx on _hyper_5_5_chunk (actual rows=1 loops=1)
Index Cond: ("time" >= '-2147483648'::integer)
-> Partial GroupAggregate (actual rows=1 loops=1)
Group Key: time_bucket(10, _hyper_5_6_chunk."time")
-> Index Scan Backward using _hyper_5_6_chunk_boundary_test_time_idx on _hyper_5_6_chunk (actual rows=1 loops=1)
Index Cond: ("time" >= '-2147483648'::integer)
-> Partial GroupAggregate (actual rows=1 loops=1)
Group Key: time_bucket(10, _hyper_5_7_chunk."time")
-> Index Scan Backward using _hyper_5_7_chunk_boundary_test_time_idx on _hyper_5_7_chunk (actual rows=1 loops=1)
Index Cond: ("time" >= '-2147483648'::integer)
-> Partial GroupAggregate (actual rows=1 loops=1)
Group Key: time_bucket(10, _hyper_5_8_chunk."time")
-> Index Scan Backward using _hyper_5_8_chunk_boundary_test_time_idx on _hyper_5_8_chunk (actual rows=1 loops=1)
Index Cond: ("time" >= '-2147483648'::integer)
(22 rows)
-> Partial GroupAggregate (actual rows=1 loops=1)
Group Key: time_bucket(10, _hyper_5_5_chunk."time")
-> Index Scan Backward using _hyper_5_5_chunk_boundary_test_time_idx on _hyper_5_5_chunk (actual rows=1 loops=1)
Index Cond: ("time" >= '-2147483648'::integer)
-> Partial GroupAggregate (actual rows=1 loops=1)
Group Key: time_bucket(10, _hyper_5_6_chunk."time")
-> Index Scan Backward using _hyper_5_6_chunk_boundary_test_time_idx on _hyper_5_6_chunk (actual rows=1 loops=1)
Index Cond: ("time" >= '-2147483648'::integer)
-> Partial GroupAggregate (actual rows=1 loops=1)
Group Key: time_bucket(10, _hyper_5_7_chunk."time")
-> Index Scan Backward using _hyper_5_7_chunk_boundary_test_time_idx on _hyper_5_7_chunk (actual rows=1 loops=1)
Index Cond: ("time" >= '-2147483648'::integer)
-> Partial GroupAggregate (actual rows=1 loops=1)
Group Key: time_bucket(10, _hyper_5_8_chunk."time")
-> Index Scan Backward using _hyper_5_8_chunk_boundary_test_time_idx on _hyper_5_8_chunk (actual rows=1 loops=1)
Index Cond: ("time" >= '-2147483648'::integer)
(20 rows)

-- result should have 4 rows
SELECT * FROM boundary_view ORDER BY time_bucket;
Expand All @@ -403,26 +401,24 @@ SELECT _timescaledb_functions.cagg_watermark(:boundary_view_id);

-- both sides of the UNION should return 2 rows
:PREFIX SELECT * FROM boundary_view;
QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------------------------
QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------------------
Append (actual rows=4 loops=1)
-> Index Scan using _hyper_6_9_chunk__materialized_hypertable_6_time_bucket_idx on _hyper_6_9_chunk (actual rows=2 loops=1)
Index Cond: (time_bucket < 30)
-> Finalize GroupAggregate (actual rows=2 loops=1)
Group Key: (time_bucket(10, _hyper_5_7_chunk."time"))
-> Sort (actual rows=2 loops=1)
-> Merge Append (actual rows=2 loops=1)
Sort Key: (time_bucket(10, _hyper_5_7_chunk."time"))
Sort Method: quicksort
-> Append (actual rows=2 loops=1)
-> Partial GroupAggregate (actual rows=1 loops=1)
Group Key: time_bucket(10, _hyper_5_7_chunk."time")
-> Index Scan Backward using _hyper_5_7_chunk_boundary_test_time_idx on _hyper_5_7_chunk (actual rows=1 loops=1)
Index Cond: ("time" >= 30)
-> Partial GroupAggregate (actual rows=1 loops=1)
Group Key: time_bucket(10, _hyper_5_8_chunk."time")
-> Index Scan Backward using _hyper_5_8_chunk_boundary_test_time_idx on _hyper_5_8_chunk (actual rows=1 loops=1)
Index Cond: ("time" >= 30)
(17 rows)
-> Partial GroupAggregate (actual rows=1 loops=1)
Group Key: time_bucket(10, _hyper_5_7_chunk."time")
-> Index Scan Backward using _hyper_5_7_chunk_boundary_test_time_idx on _hyper_5_7_chunk (actual rows=1 loops=1)
Index Cond: ("time" >= 30)
-> Partial GroupAggregate (actual rows=1 loops=1)
Group Key: time_bucket(10, _hyper_5_8_chunk."time")
-> Index Scan Backward using _hyper_5_8_chunk_boundary_test_time_idx on _hyper_5_8_chunk (actual rows=1 loops=1)
Index Cond: ("time" >= 30)
(15 rows)

-- result should have 4 rows
SELECT * FROM boundary_view ORDER BY time_bucket;
Expand Down
50 changes: 24 additions & 26 deletions tsl/test/expected/continuous_aggs-16.out
Original file line number Diff line number Diff line change
Expand Up @@ -2035,8 +2035,8 @@ SELECT * FROM mat_m1;

-- Merge Append
EXPLAIN (COSTS OFF) SELECT * FROM mat_m1;
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------
QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------
Merge Append
Sort Key: _hyper_59_123_chunk.sum DESC
-> Merge Append
Expand All @@ -2049,18 +2049,17 @@ EXPLAIN (COSTS OFF) SELECT * FROM mat_m1;
Sort Key: (sum(_hyper_52_111_chunk.temperature)) DESC
-> Finalize GroupAggregate
Group Key: (time_bucket('@ 7 days'::interval, _hyper_52_111_chunk.timec))
-> Sort
-> Merge Append
Sort Key: (time_bucket('@ 7 days'::interval, _hyper_52_111_chunk.timec))
-> Append
-> Partial GroupAggregate
Group Key: time_bucket('@ 7 days'::interval, _hyper_52_111_chunk.timec)
-> Index Scan Backward using _hyper_52_111_chunk_conditions_timec_idx on _hyper_52_111_chunk
Index Cond: (timec >= 'Sun Nov 04 16:00:00 2018 PST'::timestamp with time zone)
-> Partial GroupAggregate
Group Key: time_bucket('@ 7 days'::interval, _hyper_52_125_chunk.timec)
-> Index Scan Backward using _hyper_52_125_chunk_conditions_timec_idx on _hyper_52_125_chunk
Index Cond: (timec >= 'Sun Nov 04 16:00:00 2018 PST'::timestamp with time zone)
(23 rows)
-> Partial GroupAggregate
Group Key: time_bucket('@ 7 days'::interval, _hyper_52_111_chunk.timec)
-> Index Scan Backward using _hyper_52_111_chunk_conditions_timec_idx on _hyper_52_111_chunk
Index Cond: (timec >= 'Sun Nov 04 16:00:00 2018 PST'::timestamp with time zone)
-> Partial GroupAggregate
Group Key: time_bucket('@ 7 days'::interval, _hyper_52_125_chunk.timec)
-> Index Scan Backward using _hyper_52_125_chunk_conditions_timec_idx on _hyper_52_125_chunk
Index Cond: (timec >= 'Sun Nov 04 16:00:00 2018 PST'::timestamp with time zone)
(22 rows)

-- Ordering by another column
SELECT * FROM mat_m1 ORDER BY count;
Expand All @@ -2073,8 +2072,8 @@ SELECT * FROM mat_m1 ORDER BY count;
(4 rows)

EXPLAIN (COSTS OFF) SELECT * FROM mat_m1 ORDER BY count;
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------------
QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------------
Sort
Sort Key: _hyper_59_123_chunk.count
-> Merge Append
Expand All @@ -2089,18 +2088,17 @@ EXPLAIN (COSTS OFF) SELECT * FROM mat_m1 ORDER BY count;
Sort Key: (sum(_hyper_52_111_chunk.temperature)) DESC
-> Finalize GroupAggregate
Group Key: (time_bucket('@ 7 days'::interval, _hyper_52_111_chunk.timec))
-> Sort
-> Merge Append
Sort Key: (time_bucket('@ 7 days'::interval, _hyper_52_111_chunk.timec))
-> Append
-> Partial GroupAggregate
Group Key: time_bucket('@ 7 days'::interval, _hyper_52_111_chunk.timec)
-> Index Scan Backward using _hyper_52_111_chunk_conditions_timec_idx on _hyper_52_111_chunk
Index Cond: (timec >= 'Sun Nov 04 16:00:00 2018 PST'::timestamp with time zone)
-> Partial GroupAggregate
Group Key: time_bucket('@ 7 days'::interval, _hyper_52_125_chunk.timec)
-> Index Scan Backward using _hyper_52_125_chunk_conditions_timec_idx on _hyper_52_125_chunk
Index Cond: (timec >= 'Sun Nov 04 16:00:00 2018 PST'::timestamp with time zone)
(25 rows)
-> Partial GroupAggregate
Group Key: time_bucket('@ 7 days'::interval, _hyper_52_111_chunk.timec)
-> Index Scan Backward using _hyper_52_111_chunk_conditions_timec_idx on _hyper_52_111_chunk
Index Cond: (timec >= 'Sun Nov 04 16:00:00 2018 PST'::timestamp with time zone)
-> Partial GroupAggregate
Group Key: time_bucket('@ 7 days'::interval, _hyper_52_125_chunk.timec)
-> Index Scan Backward using _hyper_52_125_chunk_conditions_timec_idx on _hyper_52_125_chunk
Index Cond: (timec >= 'Sun Nov 04 16:00:00 2018 PST'::timestamp with time zone)
(24 rows)

-- Change the type of cagg
ALTER MATERIALIZED VIEW mat_m1 SET (timescaledb.materialized_only=true);
Expand Down

0 comments on commit f9186ea

Please sign in to comment.