Skip to content

Commit

Permalink
Add jobs to timescaledb_information.policy_stats
Browse files Browse the repository at this point in the history
Add the compression and continuous aggs job types to the
timescaledb_information.policy_stats view. It is a bug
that it wasn't there before.
  • Loading branch information
cevian committed Jan 3, 2020
1 parent d52b48e commit e44be9c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ that a backfill can trigger. By default, all invalidations are processed.
* #1591 Fix locf treat_null_as_missing option
* #1594 Fix error in compression constraint check
* #1607 Delete compression policy when drop hypertable
* #1608 Add jobs to timescaledb_information.policy_stats

**Thanks**
* @optijon for reporting an issue with locf treat_null_as_missing option
Expand Down
4 changes: 3 additions & 1 deletion sql/views.sql
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ CREATE OR REPLACE VIEW timescaledb_information.policy_stats as
SELECT format('%1$I.%2$I', ht.schema_name, ht.table_name)::regclass as hypertable, p.job_id, j.job_type, js.last_run_success, js.last_finish, js.last_successful_finish, js.last_start, js.next_start,
js.total_runs, js.total_failures
FROM (SELECT job_id, hypertable_id FROM _timescaledb_config.bgw_policy_reorder
UNION SELECT job_id, hypertable_id FROM _timescaledb_config.bgw_policy_drop_chunks) p
UNION SELECT job_id, hypertable_id FROM _timescaledb_config.bgw_policy_drop_chunks
UNION SELECT job_id, hypertable_id FROM _timescaledb_config.bgw_policy_compress_chunks
UNION SELECT job_id, raw_hypertable_id FROM _timescaledb_catalog.continuous_agg) p
INNER JOIN _timescaledb_catalog.hypertable ht ON p.hypertable_id = ht.id
INNER JOIN _timescaledb_config.bgw_job j ON p.job_id = j.id
INNER JOIN _timescaledb_internal.bgw_job_stat js on p.job_id = js.job_id
Expand Down

0 comments on commit e44be9c

Please sign in to comment.