triggerTSDBCompaction

Syntax

triggerTSDBCompaction(chunkId, [level=0])

Arguments

chunkId is a STRING scalar indicating the chunk ID.

level (optional) is an integer in [0,3] that specifies at which level the compaction is triggered. The default value is 0, meaning compaction is triggered at level 0.

Note: If keepDuplicates of the table is set to ALL, level cannot be 3.

Details

In the TSDB engine, use this command to manually trigger the compaction of TSDB level files at specific levelof all level files stored at level 0 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)
}