On PostgreSQL 15.6 and TimescaleDB 2.14.2 self-host on prem, I have table with the following three columns:
- time
- device_id
- company
Test 1:
I have executed compression according to official documentation.
ALTER TABLE my_table SET (timescaledb.compress, timescaledb.compress_orderby='time');
Compressed chunk sizes are 75% size of uncompressed chunks.
Test 2:
I have uncompressed the chunks according to the same documentation source that should compress even more data with:
ALTER TABLE my_table SET (timescaledb.compress, timescaledb.compress_segmentby='device_id', timescaledb.compress_orderby='time' );
But to my surprise compressed chunks size are 120%-200% of size of uncompressed table. Compressed table is much larger. Interesting. Any idea why?
Are there some guidelines what is the best approach to great compression and also good SQL query times?