Description
This page https://docs.timescale.com/api/latest/informational-views/jobs/ has an example with this query to find all jobs related to compression policies:
SELECT * FROM timescaledb_information.jobs where application_name like 'Compression%';
I have TimescaleDB 2.20 on my developer's machine. I have several tables in my database with enabled compression (columnstore) policy.
I ran the following query:
zabbix=# SELECT hypertable_name, application_name, proc_name, config from timescaledb_information.jobs;
hypertable_name | application_name | proc_name | config
-----------------+--------------------------------------+-----------------------------------+------------------------------------------------
| Job History Log Retention Policy [3] | policy_job_stat_history_retention | {"drop_after": "1 month"}
| Telemetry Reporter [1] | policy_telemetry |
history | Columnstore Policy [1000] | policy_compression | {"hypertable_id": 1, "compress_after": 612000}
history_uint | Columnstore Policy [1001] | policy_compression | {"hypertable_id": 2, "compress_after": 612000}
history_str | Columnstore Policy [1002] | policy_compression | {"hypertable_id": 5, "compress_after": 612000}
history_text | Columnstore Policy [1003] | policy_compression | {"hypertable_id": 4, "compress_after": 612000}
history_log | Columnstore Policy [1004] | policy_compression | {"hypertable_id": 3, "compress_after": 612000}
trends | Columnstore Policy [1005] | policy_compression | {"hypertable_id": 6, "compress_after": 612000}
trends_uint | Columnstore Policy [1006] | policy_compression | {"hypertable_id": 7, "compress_after": 612000}
(9 rows)
I see that in one of the newest TimescaleDB versions application_name was renamed from Compression% to Columnstore Policy%. I assume that the documentation page https://docs.timescale.com/api/latest/informational-views/jobs/ should be updated with an up to date example.
The example should probably explain that application_name used to be Compression% before specific TimescaleDB versions, so that there would be no surprise.
What would be a reliable universal approach to find all jobs related to compression policies which works on old and new TimescaleDB versions before and after this change