timescale / doctor

Rule-based recommendations about your timeseries database.
Apache License 2.0
4 stars 3 forks source link

Check that compress_chunk_interval is used correctly #21

Open mkindahl opened 1 year ago

mkindahl commented 1 year ago

If timescaledb.compress_chunk_interval is used the time column should be first in the timescaledb.compress_orderby list for the compression settings and also be marked as ascending.

antekresic commented 1 year ago

The technical reason is that we merge the chunks over time dimension so having compressed data not ordered over the time dimension primarily will create unordered compressed data.

The reason why we need ASC ordering is because we merge chunks in ascending order i.e. newer chunks get merged into older ones.

Both cases create unordered compressed chunks which need to be recompressed fully which is the cause of the performance hit.