decompress_chunk()
If you need to modify or add data to a chunk that has already been compressed, you need to decompress the chunk first. This is especially useful for backfilling old data.
note
Before decompressing chunks, stop any compression policy on the hypertable you are decompressing. When you finish backfilling or updating data, turn the policy back on. The database automatically recompresses your chunks in the next scheduled job.
Required arguments
Name | Type | Description |
---|---|---|
chunk_name | REGCLASS | Name of the chunk to be decompressed. |
Optional arguments
Name | Type | Description |
---|---|---|
if_compressed | BOOLEAN | Setting to true skips chunks that are not compressed. Defaults to false. |
Sample usage
Decompress a single chunk:
SELECT decompress_chunk('_timescaledb_internal._hyper_2_2_chunk');
Decompress all compressed chunks in a hypertable named metrics
:
SELECT decompress_chunk(c, true) FROM show_chunks('metrics') c;
当前内容版权归 TimescaleDB 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 TimescaleDB .