mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-16 10:33:27 +08:00
Rename policy_stats view
Rename policy_stats view to job_stats
This commit is contained in:
parent
02ad8b4e7e
commit
98e1aa25ef
@ -47,7 +47,7 @@ CREATE OR REPLACE VIEW timescaledb_information.license AS
|
||||
_timescaledb_internal.license_expiration_time() <= now() AS expired,
|
||||
_timescaledb_internal.license_expiration_time() AS expiration_time;
|
||||
|
||||
CREATE OR REPLACE VIEW timescaledb_information.policy_stats as
|
||||
CREATE OR REPLACE VIEW timescaledb_information.job_stats as
|
||||
SELECT format('%1$I.%2$I', ht.schema_name, ht.table_name)::regclass as hypertable, j.id AS job_id,
|
||||
js.last_start as last_run_started_at,
|
||||
js.last_successful_finish as last_successful_finish,
|
||||
|
@ -541,7 +541,7 @@ WHERE refclassid = 'pg_catalog.pg_extension'::pg_catalog.regclass AND
|
||||
timescaledb_information.data_node
|
||||
timescaledb_information.continuous_aggregates
|
||||
timescaledb_information.jobs
|
||||
timescaledb_information.policy_stats
|
||||
timescaledb_information.job_stats
|
||||
timescaledb_information.license
|
||||
timescaledb_information.hypertables
|
||||
_timescaledb_internal.compressed_chunk_stats
|
||||
|
@ -58,7 +58,7 @@ SELECT * FROM _timescaledb_config.bgw_job;
|
||||
----+------------------+-------------------+-------------+-------------+--------------+-------------+-----------+-------+-----------+---------------+--------
|
||||
(0 rows)
|
||||
|
||||
SELECT * FROM timescaledb_information.policy_stats;
|
||||
SELECT * FROM timescaledb_information.job_stats;
|
||||
hypertable | job_id | last_run_started_at | last_successful_finish | last_run_status | job_status | last_run_duration | next_scheduled_run | total_runs | total_successes | total_failures
|
||||
------------+--------+---------------------+------------------------+-----------------+------------+-------------------+--------------------+------------+-----------------+----------------
|
||||
(0 rows)
|
||||
@ -291,7 +291,7 @@ SELECT indexrelid::regclass, indisclustered
|
||||
(3 rows)
|
||||
|
||||
--check that views work correctly
|
||||
SELECT * FROM timescaledb_information.policy_stats;
|
||||
SELECT * FROM timescaledb_information.job_stats;
|
||||
hypertable | job_id | last_run_started_at | last_successful_finish | last_run_status | job_status | last_run_duration | next_scheduled_run | total_runs | total_successes | total_failures
|
||||
--------------------+--------+---------------------------------+---------------------------------+-----------------+------------+-------------------+---------------------------------+------------+-----------------+----------------
|
||||
test_reorder_table | 1000 | Fri Dec 31 16:00:00.05 1999 PST | Fri Dec 31 16:00:00.05 1999 PST | Success | Scheduled | | Tue Jan 04 16:00:00.05 2000 PST | 3 | 3 | 0
|
||||
@ -568,7 +568,7 @@ SELECT show_chunks('test_drop_chunks_table');
|
||||
(3 rows)
|
||||
|
||||
--test that views work
|
||||
SELECT * FROM timescaledb_information.policy_stats;
|
||||
SELECT * FROM timescaledb_information.job_stats;
|
||||
hypertable | job_id | last_run_started_at | last_successful_finish | last_run_status | job_status | last_run_duration | next_scheduled_run | total_runs | total_successes | total_failures
|
||||
------------------------+--------+------------------------------+------------------------------+-----------------+------------+-------------------+------------------------------+------------+-----------------+----------------
|
||||
test_drop_chunks_table | 1001 | Fri Dec 31 16:00:01 1999 PST | Fri Dec 31 16:00:01 1999 PST | Success | Scheduled | | Fri Dec 31 16:00:02 1999 PST | 2 | 2 | 0
|
||||
|
@ -57,7 +57,7 @@ SELECT * FROM _timescaledb_config.bgw_job;
|
||||
----+------------------+-------------------+-------------+-------------+--------------+-------------+-----------+-------+-----------+---------------+--------
|
||||
(0 rows)
|
||||
|
||||
SELECT * FROM timescaledb_information.policy_stats;
|
||||
SELECT * FROM timescaledb_information.job_stats;
|
||||
hypertable | job_id | last_run_started_at | last_successful_finish | last_run_status | job_status | last_run_duration | next_scheduled_run | total_runs | total_successes | total_failures
|
||||
------------+--------+---------------------+------------------------+-----------------+------------+-------------------+--------------------+------------+-----------------+----------------
|
||||
(0 rows)
|
||||
@ -466,7 +466,7 @@ view_definition | SELECT time_bucket(2, test_continuous_agg_table."time") AS ti
|
||||
| GROUP BY (time_bucket(2, test_continuous_agg_table."time"));
|
||||
|
||||
select job_status, last_run_duration
|
||||
from timescaledb_information.policy_stats ps, timescaledb_information.continuous_aggregates cagg
|
||||
from timescaledb_information.job_stats ps, timescaledb_information.continuous_aggregates cagg
|
||||
where cagg.view_name::text like '%test_continuous_agg_view'
|
||||
and cagg.materialization_hypertable = ps.hypertable;
|
||||
-[ RECORD 1 ]-----+----------
|
||||
|
@ -62,7 +62,7 @@ INSERT INTO public.bgw_dsm_handle_store VALUES (0);
|
||||
SELECT ts_bgw_params_create();
|
||||
|
||||
SELECT * FROM _timescaledb_config.bgw_job;
|
||||
SELECT * FROM timescaledb_information.policy_stats;
|
||||
SELECT * FROM timescaledb_information.job_stats;
|
||||
|
||||
\c :TEST_DBNAME :ROLE_DEFAULT_PERM_USER
|
||||
|
||||
@ -169,7 +169,7 @@ SELECT indexrelid::regclass, indisclustered
|
||||
WHERE indisclustered = true ORDER BY 1;
|
||||
|
||||
--check that views work correctly
|
||||
SELECT * FROM timescaledb_information.policy_stats;
|
||||
SELECT * FROM timescaledb_information.job_stats;
|
||||
|
||||
-- test deleting the policy
|
||||
SELECT remove_reorder_policy('test_reorder_table');
|
||||
@ -284,4 +284,4 @@ SELECT job_id, time_bucket('1m',next_start) AS next_start, time_bucket('1m',last
|
||||
SELECT show_chunks('test_drop_chunks_table');
|
||||
|
||||
--test that views work
|
||||
SELECT * FROM timescaledb_information.policy_stats;
|
||||
SELECT * FROM timescaledb_information.job_stats;
|
||||
|
@ -66,7 +66,7 @@ INSERT INTO public.bgw_dsm_handle_store VALUES (0);
|
||||
SELECT ts_bgw_params_create();
|
||||
|
||||
SELECT * FROM _timescaledb_config.bgw_job;
|
||||
SELECT * FROM timescaledb_information.policy_stats;
|
||||
SELECT * FROM timescaledb_information.job_stats;
|
||||
SELECT * FROM _timescaledb_catalog.continuous_agg;
|
||||
|
||||
\c :TEST_DBNAME :ROLE_DEFAULT_PERM_USER
|
||||
@ -272,7 +272,7 @@ select view_name, view_definition from timescaledb_information.continuous_aggreg
|
||||
where view_name::text like '%test_continuous_agg_view';
|
||||
|
||||
select job_status, last_run_duration
|
||||
from timescaledb_information.policy_stats ps, timescaledb_information.continuous_aggregates cagg
|
||||
from timescaledb_information.job_stats ps, timescaledb_information.continuous_aggregates cagg
|
||||
where cagg.view_name::text like '%test_continuous_agg_view'
|
||||
and cagg.materialization_hypertable = ps.hypertable;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user