Skip to content

Commit

Permalink
test 13
Browse files Browse the repository at this point in the history
  • Loading branch information
cevian committed Mar 17, 2024
1 parent 5d2b67b commit 2ce06d3
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 6 deletions.
2 changes: 2 additions & 0 deletions tsl/test/expected/bgw_custom-13.out
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,8 @@ INSERT INTO sensor_data
time;
-- enable compression
ALTER TABLE sensor_data SET (timescaledb.compress, timescaledb.compress_orderby = 'time DESC');
WARNING: there was some uncertainty picking the default segment by for the hypertable: You do not have any indexes on columns that can be used for segment_by and thus we are not using segment_by for compression. Please make sure you are not missing any indexes
NOTICE: default segment by for hypertable "sensor_data" is set to ""
-- create new chunks
INSERT INTO sensor_data
SELECT
Expand Down
8 changes: 8 additions & 0 deletions tsl/test/expected/cagg_ddl-13.out
Original file line number Diff line number Diff line change
Expand Up @@ -1508,6 +1508,8 @@ INSERT INTO test_setting VALUES( '2020-11-01', 20);
--try out 2 settings here --
ALTER MATERIALIZED VIEW test_setting_cagg SET (timescaledb.materialized_only = 'true', timescaledb.compress='true');
NOTICE: defaulting compress_orderby to time_bucket
WARNING: there was some uncertainty picking the default segment by for the hypertable: You do not have any indexes on columns that can be used for segment_by and thus we are not using segment_by for compression. Please make sure you are not missing any indexes
NOTICE: default segment by for hypertable "_materialized_hypertable_40" is set to ""
SELECT view_name, compression_enabled, materialized_only
FROM timescaledb_information.continuous_aggregates
where view_name = 'test_setting_cagg';
Expand All @@ -1526,6 +1528,8 @@ SELECT count(*) from test_setting_cagg ORDER BY 1;
--now set it back to false --
ALTER MATERIALIZED VIEW test_setting_cagg SET (timescaledb.materialized_only = 'false', timescaledb.compress='true');
NOTICE: defaulting compress_orderby to time_bucket
WARNING: there was some uncertainty picking the default segment by for the hypertable: You do not have any indexes on columns that can be used for segment_by and thus we are not using segment_by for compression. Please make sure you are not missing any indexes
NOTICE: default segment by for hypertable "_materialized_hypertable_40" is set to ""
SELECT view_name, compression_enabled, materialized_only
FROM timescaledb_information.continuous_aggregates
where view_name = 'test_setting_cagg';
Expand Down Expand Up @@ -1593,6 +1597,8 @@ INSERT INTO test_setting VALUES( '2020-11-01', 20);
--try out 2 settings here --
ALTER MATERIALIZED VIEW test_setting_cagg SET (timescaledb.materialized_only = 'false', timescaledb.compress='true');
NOTICE: defaulting compress_orderby to time_bucket
WARNING: there was some uncertainty picking the default segment by for the hypertable: You do not have any indexes on columns that can be used for segment_by and thus we are not using segment_by for compression. Please make sure you are not missing any indexes
NOTICE: default segment by for hypertable "_materialized_hypertable_42" is set to ""
SELECT view_name, compression_enabled, materialized_only
FROM timescaledb_information.continuous_aggregates
where view_name = 'test_setting_cagg';
Expand All @@ -1611,6 +1617,8 @@ SELECT count(*) from test_setting_cagg ORDER BY 1;
--now set it back to false --
ALTER MATERIALIZED VIEW test_setting_cagg SET (timescaledb.materialized_only = 'true', timescaledb.compress='true');
NOTICE: defaulting compress_orderby to time_bucket
WARNING: there was some uncertainty picking the default segment by for the hypertable: You do not have any indexes on columns that can be used for segment_by and thus we are not using segment_by for compression. Please make sure you are not missing any indexes
NOTICE: default segment by for hypertable "_materialized_hypertable_42" is set to ""
SELECT view_name, compression_enabled, materialized_only
FROM timescaledb_information.continuous_aggregates
where view_name = 'test_setting_cagg';
Expand Down
18 changes: 18 additions & 0 deletions tsl/test/expected/compression_bgw-13.out
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ SELECT set_integer_now_func('test_table_smallint', 'dummy_now_smallint');

INSERT INTO test_table_smallint SELECT generate_series(1,5), 10;
ALTER TABLE test_table_smallint SET (timescaledb.compress);
WARNING: there was some uncertainty picking the default segment by for the hypertable: You do not have any indexes on columns that can be used for segment_by and thus we are not using segment_by for compression. Please make sure you are not missing any indexes
NOTICE: default segment by for hypertable "test_table_smallint" is set to ""
NOTICE: default order by for hypertable "test_table_smallint" is set to ""time" DESC"
\set ON_ERROR_STOP 0
select add_compression_policy( 'test_table_smallint', compress_after=> '1 day'::interval );
ERROR: invalid value for parameter compress_after
Expand Down Expand Up @@ -193,6 +196,9 @@ SELECT set_integer_now_func('test_table_integer', 'dummy_now_integer');

INSERT INTO test_table_integer SELECT generate_series(1,5), 10;
ALTER TABLE test_table_integer SET (timescaledb.compress);
WARNING: there was some uncertainty picking the default segment by for the hypertable: You do not have any indexes on columns that can be used for segment_by and thus we are not using segment_by for compression. Please make sure you are not missing any indexes
NOTICE: default segment by for hypertable "test_table_integer" is set to ""
NOTICE: default order by for hypertable "test_table_integer" is set to ""time" DESC"
SELECT add_compression_policy('test_table_integer', 2::INTEGER) AS compressjob_id \gset
SELECT * FROM _timescaledb_config.bgw_job WHERE id = :compressjob_id;
id | application_name | schedule_interval | max_runtime | max_retries | retry_period | proc_schema | proc_name | owner | scheduled | fixed_schedule | initial_start | hypertable_id | config | check_schema | check_name | timezone
Expand Down Expand Up @@ -230,6 +236,9 @@ SELECT set_integer_now_func('test_table_bigint', 'dummy_now_bigint');

INSERT INTO test_table_bigint SELECT generate_series(1,5), 10;
ALTER TABLE test_table_bigint SET (timescaledb.compress);
WARNING: there was some uncertainty picking the default segment by for the hypertable: You do not have any indexes on columns that can be used for segment_by and thus we are not using segment_by for compression. Please make sure you are not missing any indexes
NOTICE: default segment by for hypertable "test_table_bigint" is set to ""
NOTICE: default order by for hypertable "test_table_bigint" is set to ""time" DESC"
SELECT add_compression_policy('test_table_bigint', 2::BIGINT) AS compressjob_id \gset
SELECT * FROM _timescaledb_config.bgw_job WHERE id = :compressjob_id;
id | application_name | schedule_interval | max_runtime | max_retries | retry_period | proc_schema | proc_name | owner | scheduled | fixed_schedule | initial_start | hypertable_id | config | check_schema | check_name | timezone
Expand Down Expand Up @@ -267,6 +276,9 @@ SELECT set_integer_now_func('test_table_nologin', 'dummy_now_bigint');
(1 row)

ALTER TABLE test_table_nologin set (timescaledb.compress);
WARNING: there was some uncertainty picking the default segment by for the hypertable: You do not have any indexes on columns that can be used for segment_by and thus we are not using segment_by for compression. Please make sure you are not missing any indexes
NOTICE: default segment by for hypertable "test_table_nologin" is set to ""
NOTICE: default order by for hypertable "test_table_nologin" is set to ""time" DESC"
\set ON_ERROR_STOP 0
SELECT add_compression_policy('test_table_nologin', 2::int);
ERROR: permission denied to start background process as role "nologin_role"
Expand Down Expand Up @@ -300,6 +312,9 @@ FROM conditions
GROUP BY device, time_bucket(INTERVAL '1 hour', "time") WITH NO DATA;
CALL refresh_continuous_aggregate('conditions_summary', NULL, NULL);
ALTER TABLE conditions SET (timescaledb.compress);
WARNING: there was some uncertainty picking the default segment by for the hypertable: You do not have any indexes on columns that can be used for segment_by and thus we are not using segment_by for compression. Please make sure you are not missing any indexes
NOTICE: default segment by for hypertable "conditions" is set to ""
NOTICE: default order by for hypertable "conditions" is set to ""time" DESC"
SELECT COUNT(*) AS dropped_chunks_count
FROM drop_chunks('conditions', TIMESTAMPTZ '2018-12-15 00:00');
dropped_chunks_count
Expand Down Expand Up @@ -532,6 +547,9 @@ SELECT compress_chunk(:'CHUNK_NAME'::regclass);
CREATE TABLE metrics(time timestamptz NOT NULL);
SELECT hypertable_id AS "HYPERTABLE_ID", schema_name, table_name, created FROM create_hypertable('metrics','time') \gset
ALTER TABLE metrics SET (timescaledb.compress);
psql:include/recompress_basic.sql:120: WARNING: there was some uncertainty picking the default segment by for the hypertable: You do not have any indexes on columns that can be used for segment_by and thus we are not using segment_by for compression. Please make sure you are not missing any indexes
psql:include/recompress_basic.sql:120: NOTICE: default segment by for hypertable "metrics" is set to ""
psql:include/recompress_basic.sql:120: NOTICE: default order by for hypertable "metrics" is set to ""time" DESC"
-- create chunk with some data and compress
INSERT INTO metrics SELECT '2000-01-01' FROM generate_series(1,10);
-- create custom compression job without recompress boolean
Expand Down
Loading

0 comments on commit 2ce06d3

Please sign in to comment.