IoTDB supports the use of TRACING statements to enable and disable performance tracing of query statements, which is disabled by default. Users can use performance tracking tool to analyze potential performance problems in some queries. By default, the log files for performance tracing are stored in the directory ./data/tracing.
Turn on Tracingļ¼
IoTDB> TRACING ON
Turn off Tracingļ¼
IoTDB> TRACING OFF
Since the cost of an IoTDB query mainly depends on the number of time series queried, the number of tsfile files accessed, the total number of chunks to be scanned, and the average size of each chunk (the number of data points contained in the chunk). Therefore, the current performance analysis includes the following contents:
For example, execute select * from root, the contents of the tracing log file will include the following contents:
Query Id: 2 - Start time: 2020-06-28 10:53:54.727 Query Id: 2 - Query Statement: select * from root Query Id: 2 - Number of series paths: 3 Query Id: 2 - Number of sequence files: 1 Query Id: 2 - SeqFile_1603336100446-1-0.tsfile root.sg.d1[1, 10000] Query Id: 2 - Number of unsequence files: 1 Query Id: 2 - UnSeqFile_1603354798303-2-0.tsfile root.sg.d1[9, 1000] Query Id: 2 - Number of chunks: 3 Query Id: 2 - Average size of chunks: 4113 Query Id: 2 - Total cost time: 11ms
In order to avoid disordered output information caused by multiple queries being executed at the same time, the Query ID is added before each output information. Users can use grep "Query ID: 2" tracing.txt to extract all tracing information of one query.