mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-23 06:22:03 +08:00
Add missing tests discovered by Codecov 3
Tests for continuous aggregates over compressed data, which also tests selecting tableoids from compressed tables.
This commit is contained in:
parent
7ae97088f3
commit
e9e7c5f38e
@ -441,15 +441,19 @@ ROLLBACK;
|
||||
DROP VIEW dependent_1;
|
||||
--create a cont agg view on the ht as well then the drop should nuke everything
|
||||
--TODO put back when cont aggs work
|
||||
--CREATE VIEW test1_cont_view WITH ( timescaledb.continuous, timescaledb.refresh_interval='72 hours')
|
||||
--AS SELECT time_bucket('1 hour', "Time"), SUM(i)
|
||||
-- FROM test1
|
||||
-- GROUP BY 1;
|
||||
--REFRESH MATERIALIZED VIEW test1_cont_view;
|
||||
--SELECT count(*) FROM test1_cont_view;
|
||||
--DROP TABLE :UNCOMPRESSED_HYPER_NAME CASCADE;
|
||||
--verify that there are no more hypertable remaining
|
||||
--SELECT count(*) FROM _timescaledb_catalog.hypertable hypertable;
|
||||
CREATE VIEW test1_cont_view WITH ( timescaledb.continuous, timescaledb.refresh_interval='72 hours')
|
||||
AS SELECT time_bucket('1 hour', "Time"), SUM(i)
|
||||
FROM test1
|
||||
GROUP BY 1;
|
||||
REFRESH MATERIALIZED VIEW test1_cont_view;
|
||||
INFO: new materialization range for public.test1 (time column Time) (1522216800000000)
|
||||
INFO: materializing continuous aggregate public.test1_cont_view: new range up to 1522216800000000
|
||||
SELECT count(*) FROM test1_cont_view;
|
||||
count
|
||||
-------
|
||||
6
|
||||
(1 row)
|
||||
|
||||
\c :TEST_DBNAME :ROLE_SUPERUSER
|
||||
SELECT chunk.schema_name|| '.' || chunk.table_name as "COMPRESSED_CHUNK_NAME"
|
||||
FROM _timescaledb_catalog.chunk chunk
|
||||
@ -499,7 +503,7 @@ ALTER table test1 set (timescaledb.compress='f');
|
||||
SELECT count(*) = 1 FROM _timescaledb_catalog.hypertable hypertable;
|
||||
?column?
|
||||
----------
|
||||
t
|
||||
f
|
||||
(1 row)
|
||||
|
||||
SELECT compressed_hypertable_id IS NULL FROM _timescaledb_catalog.hypertable hypertable WHERE hypertable.table_name like 'test1' ;
|
||||
@ -527,7 +531,7 @@ WHERE chunk.id IS NULL;
|
||||
|
||||
--can turn compression back on
|
||||
ALTER TABLE test1 set (timescaledb.compress, timescaledb.compress_segmentby = 'b', timescaledb.compress_orderby = '"Time" DESC');
|
||||
NOTICE: adding index _compressed_hypertable_3_b__ts_meta_sequence_num_idx ON _timescaledb_internal._compressed_hypertable_3 USING BTREE(b, _ts_meta_sequence_num)
|
||||
NOTICE: adding index _compressed_hypertable_4_b__ts_meta_sequence_num_idx ON _timescaledb_internal._compressed_hypertable_4 USING BTREE(b, _ts_meta_sequence_num)
|
||||
SELECT COUNT(*) AS count_compressed
|
||||
FROM
|
||||
(
|
||||
@ -542,7 +546,10 @@ AS sub;
|
||||
1
|
||||
(1 row)
|
||||
|
||||
DROP TABLE test1;
|
||||
DROP TABLE test1 CASCADE;
|
||||
NOTICE: drop cascades to table _timescaledb_internal.compress_hyper_4_57_chunk
|
||||
NOTICE: drop cascades to 2 other objects
|
||||
NOTICE: drop cascades to table _timescaledb_internal._hyper_3_56_chunk
|
||||
DROP TABLESPACE tablespace1;
|
||||
DROP TABLESPACE tablespace2;
|
||||
-- Triggers are NOT fired for compress/decompress
|
||||
|
@ -304,17 +304,14 @@ DROP VIEW dependent_1;
|
||||
|
||||
--create a cont agg view on the ht as well then the drop should nuke everything
|
||||
--TODO put back when cont aggs work
|
||||
--CREATE VIEW test1_cont_view WITH ( timescaledb.continuous, timescaledb.refresh_interval='72 hours')
|
||||
--AS SELECT time_bucket('1 hour', "Time"), SUM(i)
|
||||
-- FROM test1
|
||||
-- GROUP BY 1;
|
||||
CREATE VIEW test1_cont_view WITH ( timescaledb.continuous, timescaledb.refresh_interval='72 hours')
|
||||
AS SELECT time_bucket('1 hour', "Time"), SUM(i)
|
||||
FROM test1
|
||||
GROUP BY 1;
|
||||
|
||||
--REFRESH MATERIALIZED VIEW test1_cont_view;
|
||||
REFRESH MATERIALIZED VIEW test1_cont_view;
|
||||
|
||||
--SELECT count(*) FROM test1_cont_view;
|
||||
--DROP TABLE :UNCOMPRESSED_HYPER_NAME CASCADE;
|
||||
--verify that there are no more hypertable remaining
|
||||
--SELECT count(*) FROM _timescaledb_catalog.hypertable hypertable;
|
||||
SELECT count(*) FROM test1_cont_view;
|
||||
|
||||
\c :TEST_DBNAME :ROLE_SUPERUSER
|
||||
|
||||
@ -375,7 +372,7 @@ AS sub;
|
||||
|
||||
|
||||
|
||||
DROP TABLE test1;
|
||||
DROP TABLE test1 CASCADE;
|
||||
DROP TABLESPACE tablespace1;
|
||||
DROP TABLESPACE tablespace2;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user