triggerTSDBCompaction

Syntax

triggerTSDBCompaction(chunkId)

Arguments

chunkId is a STRING scalar indicating the chunk ID.

Details

In the TSDB engine, use this command to manually trigger the compaction for optimal reading performance.

Examples

There are 2 file types in a chunk, the file chunk containing information about the database and table schema, and the tablet chunk storing data. Compaction of level files can only be conducted within a tablet chunk. Set "type=1" to filter the IDs of tablet chunks.

chunkIds = exec chunkId from getChunksMeta() where type=1
for (x in chunkIds) {
    triggerTSDBCompaction(x)
}