Immutable solution version
chunk size and table size increased after compression
Complete solution
Shows how to fix chunk size and table size increased after compression. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Check your compress\_segmentby choice.
Steps
- Check your
compress_segmentbychoice. The reporter's root cause: the segment-by date column had nearly unique values, so compression could not group rows and the compressed chunks ended up larger than the originals. Pick a low-cardinality column forcompress_segmentby(something with few distinct values, like a device or region id) and re-test on a chunk. If the old badly-compressed chunks are no longer needed, drop them withdrop_chunks()before decompressing and reconfiguring, so you do not keep paying for the inflated storage. - Source: https://github.com/timescale/timescaledb/issues/5961 (Timescale Cloud)
When to use
You are seeing this: The reporter's root cause: the segment-by date column had nearly unique values, so compression could not group rows and the compressed chunks ended up larger than the originals. Use this skill when you run into "chunk size and table size increased after compression".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Sources
- https://github.com/timescale/timescaledb/issues/5961
Evidence
In gh:timescale/timescaledb#5961, the issue was: ### What type of bug is this? Incorrect result ### What subsystems and features are affected? Compression ### What happened? Hello, There is no compression job failed but chunk and table size increased after compression, so we reproduce it in local, manual compression also can make chunk and table size increased, same behavior in 2.10.1 and 2.11.1, is it a bug or table compression configuration wrongly caused please?. The verified answer: Check your compress_segmentby choice. The reporter's root cause: the segment-by date column had nearly unique values, so compression could not group rows and the compressed chunks ended up larger than the originals. Pick a low-cardinality column for compress_segmentby (something with few distinct values, like a device or region id) and re-test on a chunk.. Issue URL: https://github.com/timescale/timescaledb/issues/5961
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_pVvi6jID1m5tXZXRSgEtqQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">chunk size and table size increased after compression <span>— Vectle</span></a>