Skip to content

Commit

Permalink
Cleanup public API
Browse files Browse the repository at this point in the history
Removes unlrelated column schedule_interval from
timescaledb_information.continuous_aggregates view and simplifies it.
Renames argument cagg in refresh_continuous_aggregate into
continuous_aggregate as in add_continuous_aggregate_policy.

Part of #2521
  • Loading branch information
k-rus committed Oct 13, 2020
1 parent 85428bc commit 85095b6
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion sql/ddl_api.sql
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ AS '@MODULE_PATHNAME@', 'ts_hypertable_distributed_set_replication_factor' LANGU

-- Refresh a continuous aggregate across the given window.
CREATE OR REPLACE PROCEDURE refresh_continuous_aggregate(
cagg REGCLASS,
continuous_aggregate REGCLASS,
window_start "any",
window_end "any"
) LANGUAGE C AS '@MODULE_PATHNAME@', 'ts_continuous_agg_refresh';
4 changes: 4 additions & 0 deletions sql/updates/latest-dev.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@

DROP FUNCTION IF EXISTS detach_data_node(name,regclass,boolean,boolean);
DROP FUNCTION IF EXISTS distributed_exec;

DROP PROCEDURE IF EXISTS refresh_continuous_aggregate(regclass,"any","any");

DROP VIEW IF EXISTS timescaledb_information.continuous_aggregates;
4 changes: 1 addition & 3 deletions sql/views.sql
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,11 @@ CREATE OR REPLACE VIEW timescaledb_information.continuous_aggregates AS
SELECT cagg.user_view_schema AS view_schema,
cagg.user_view_name AS view_name,
viewinfo.viewowner AS view_owner,
bgwjob.schedule_interval,
cagg.materialized_only,
ht.schema_name AS materialization_hypertable_schema,
ht.table_name AS materialization_hypertable_name,
directview.viewdefinition AS view_definition
FROM _timescaledb_catalog.continuous_agg cagg
LEFT JOIN _timescaledb_config.bgw_job bgwjob ON bgwjob.hypertable_id = cagg.mat_hypertable_id,
FROM _timescaledb_catalog.continuous_agg cagg,
_timescaledb_catalog.hypertable ht,
LATERAL (
SELECT C.oid,
Expand Down
8 changes: 7 additions & 1 deletion test/sql/updates/post.continuous_aggs.v2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ CALL refresh_continuous_aggregate('cagg.realtime_mat',NULL,NULL);

SELECT * FROM cagg.realtime_mat ORDER BY bucket, location;

SELECT view_name, schedule_interval, materialized_only, materialization_hypertable_name FROM timescaledb_information.continuous_aggregates ORDER BY view_name::text;
SELECT view_name, materialized_only, materialization_hypertable_name
FROM timescaledb_information.continuous_aggregates
ORDER BY view_name::text;

SELECT schedule_interval
FROM timescaledb_information.jobs
ORDER BY job_id;

SELECT maxtemp FROM mat_ignoreinval ORDER BY 1;

Expand Down
1 change: 0 additions & 1 deletion tsl/test/expected/continuous_aggs_usage.out
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ SELECT * FROM timescaledb_information.continuous_aggregates;
view_schema | public
view_name | device_summary
view_owner | default_perm_user
schedule_interval | @ 2 hours
materialized_only | t
materialization_hypertable_schema | _timescaledb_internal
materialization_hypertable_name | _materialized_hypertable_2
Expand Down

0 comments on commit 85095b6

Please sign in to comment.