Hello,
After following the current guide to setup TimescaleDB i was set adrift wondering if it worked, and by searching i've found how to check the basics of the TimescaleDB implementation, as a non postgreSQL user and with not much a of a experience with databases, i've decided to share how to check it, i hope that someone may find this useful:
First, how to check the current size of your database (log in to psql first)
Then, how to check info about the database:
If your setup is correct you will see TimescaleDB items like this:
and then, to check how is your compression setup, use:
Example:
job_id | application_name | schedule_interval | max_runtime | max_retries | retry_period | proc_schema | proc_name | owner | scheduled | fixed_schedule | config | next_start | initial_start | hypertable_schema | hypertable_name | check_schema | check_name
--------+---------------------------+-------------------+-------------+-------------+--------------+-----------------------+--------------------+--------+-----------+----------------+------------------------------------------------+-------------------------------+---------------+-------------------+-----------------+-----------------------+--------------------------
1000 | Compression Policy [1000] | 1 day | 00:00:00 | -1 | 01:00:00 | _timescaledb_internal | policy_compression | zabbix | t | f | {"hypertable_id": 1, "compress_after": 612000} | 2023-08-02 16:01:33.817808-03 | | public | history | _timescaledb_internal | policy_compression_check
1001 | Compression Policy [1001] | 1 day | 00:00:00 | -1 | 01:00:00 | _timescaledb_internal | policy_compression | zabbix | t | f | {"hypertable_id": 2, "compress_after": 612000} | 2023-08-02 16:01:33.805898-03 | | public | history_uint | _timescaledb_internal | policy_compression_check
1002 | Compression Policy [1002] | 1 day | 00:00:00 | -1 | 01:00:00 | _timescaledb_internal | policy_compression | zabbix | t | f | {"hypertable_id": 5, "compress_after": 612000} | 2023-08-02 16:01:33.765747-03 | | public | history_str | _timescaledb_internal | policy_compression_check
1003 | Compression Policy [1003] | 1 day | 00:00:00 | -1 | 01:00:00 | _timescaledb_internal | policy_compression | zabbix | t | f | {"hypertable_id": 4, "compress_after": 612000} | 2023-08-02 16:01:33.786179-03 | | public | history_text | _timescaledb_internal | policy_compression_check
1004 | Compression Policy [1004] | 1 day | 00:00:00 | -1 | 01:00:00 | _timescaledb_internal | policy_compression | zabbix | t | f | {"hypertable_id": 3, "compress_after": 612000} | 2023-08-02 16:01:33.674456-03 | | public | history_log | _timescaledb_internal | policy_compression_check
1005 | Compression Policy [1005] | 1 day | 00:00:00 | -1 | 01:00:00 | _timescaledb_internal | policy_compression | zabbix | t | f | {"hypertable_id": 6, "compress_after": 612000} | 2023-08-02 16:01:33.670589-03 | | public | trends | _timescaledb_internal | policy_compression_check
1006 | Compression Policy [1006] | 1 day | 00:00:00 | -1 | 01:00:00 | _timescaledb_internal | policy_compression | zabbix | t | f | {"hypertable_id": 7, "compress_after": 612000} | 2023-08-02 16:01:33.675299-03 | | public | trends_uint | _timescaledb_internal | policy_compression_check
After following the current guide to setup TimescaleDB i was set adrift wondering if it worked, and by searching i've found how to check the basics of the TimescaleDB implementation, as a non postgreSQL user and with not much a of a experience with databases, i've decided to share how to check it, i hope that someone may find this useful:
First, how to check the current size of your database (log in to psql first)
zabbix=> SELECT pg_size_pretty( pg_database_size('zabbix') );
pg_size_pretty
----------------
599 MB
(1 row)
pg_size_pretty
----------------
599 MB
(1 row)
Then, how to check info about the database:
SELECT table_schema, table_name
FROM information_schema.tables
WHERE table_catalog = 'zabbix'
AND table_schema NOT LIKE 'pg_%'
AND table_schema != 'zabbix'
ORDER BY table_schema, table_name;
FROM information_schema.tables
WHERE table_catalog = 'zabbix'
AND table_schema NOT LIKE 'pg_%'
AND table_schema != 'zabbix'
ORDER BY table_schema, table_name;
table_schema | table_name
--------------------------+--------------------------------------------------
_timescaledb_cache | cache_inval_bgw_job
_timescaledb_cache | cache_inval_extension
_timescaledb_cache | cache_inval_hypertable
_timescaledb_catalog | chunk
--------------------------+--------------------------------------------------
_timescaledb_cache | cache_inval_bgw_job
_timescaledb_cache | cache_inval_extension
_timescaledb_cache | cache_inval_hypertable
_timescaledb_catalog | chunk
and then, to check how is your compression setup, use:
SELECT * FROM timescaledb_information.jobs
WHERE proc_name='policy_compression';
WHERE proc_name='policy_compression';
Example:
job_id | application_name | schedule_interval | max_runtime | max_retries | retry_period | proc_schema | proc_name | owner | scheduled | fixed_schedule | config | next_start | initial_start | hypertable_schema | hypertable_name | check_schema | check_name
--------+---------------------------+-------------------+-------------+-------------+--------------+-----------------------+--------------------+--------+-----------+----------------+------------------------------------------------+-------------------------------+---------------+-------------------+-----------------+-----------------------+--------------------------
1000 | Compression Policy [1000] | 1 day | 00:00:00 | -1 | 01:00:00 | _timescaledb_internal | policy_compression | zabbix | t | f | {"hypertable_id": 1, "compress_after": 612000} | 2023-08-02 16:01:33.817808-03 | | public | history | _timescaledb_internal | policy_compression_check
1001 | Compression Policy [1001] | 1 day | 00:00:00 | -1 | 01:00:00 | _timescaledb_internal | policy_compression | zabbix | t | f | {"hypertable_id": 2, "compress_after": 612000} | 2023-08-02 16:01:33.805898-03 | | public | history_uint | _timescaledb_internal | policy_compression_check
1002 | Compression Policy [1002] | 1 day | 00:00:00 | -1 | 01:00:00 | _timescaledb_internal | policy_compression | zabbix | t | f | {"hypertable_id": 5, "compress_after": 612000} | 2023-08-02 16:01:33.765747-03 | | public | history_str | _timescaledb_internal | policy_compression_check
1003 | Compression Policy [1003] | 1 day | 00:00:00 | -1 | 01:00:00 | _timescaledb_internal | policy_compression | zabbix | t | f | {"hypertable_id": 4, "compress_after": 612000} | 2023-08-02 16:01:33.786179-03 | | public | history_text | _timescaledb_internal | policy_compression_check
1004 | Compression Policy [1004] | 1 day | 00:00:00 | -1 | 01:00:00 | _timescaledb_internal | policy_compression | zabbix | t | f | {"hypertable_id": 3, "compress_after": 612000} | 2023-08-02 16:01:33.674456-03 | | public | history_log | _timescaledb_internal | policy_compression_check
1005 | Compression Policy [1005] | 1 day | 00:00:00 | -1 | 01:00:00 | _timescaledb_internal | policy_compression | zabbix | t | f | {"hypertable_id": 6, "compress_after": 612000} | 2023-08-02 16:01:33.670589-03 | | public | trends | _timescaledb_internal | policy_compression_check
1006 | Compression Policy [1006] | 1 day | 00:00:00 | -1 | 01:00:00 | _timescaledb_internal | policy_compression | zabbix | t | f | {"hypertable_id": 7, "compress_after": 612000} | 2023-08-02 16:01:33.675299-03 | | public | trends_uint | _timescaledb_internal | policy_compression_check

Comment