Skip to content

convert_to_columnstore()

Manually add a chunk to the columnstore

Since 2.18.0

Manually convert a specific chunk in the hypertable rowstore to the columnstore.

Although convert_to_columnstore gives you more fine-grained control, best practice is to use add_columnstore_policy. You can also add chunks to the columnstore at a specific time running the job associated with your columnstore policy manually.

To move a chunk from the columnstore back to the rowstore, use convert_to_rowstore.

To convert a single chunk to columnstore:

CALL convert_to_columnstore('_timescaledb_internal._hyper_1_2_chunk');

The syntax is:

CALL convert_to_columnstore(
chunk = '<chunk_name>',
if_not_columnstore = true | false,
recompress = true | false
);
NameTypeDefaultRequiredDescription
chunkREGCLASS-Name of the chunk to add to the columnstore.
if_not_columnstoreBOOLEANtrueSet to false so this call fails with an error rather than a warning if chunk is already in the columnstore.
recompressBOOLEANfalseSet to true to recompress. In-memory recompression is attempted first; it falls back to internal decompress/compress.

This function returns void.