CREATE TABLE 'sys_telemetry' (
timestamp TIMESTAMP,
deviceId INT,
propId INT,
propValue FLOAT,
maxValue FLOAT,
maxValueTime TIMESTAMP,
minValue FLOAT,
minValueTime TIMESTAMP,
avgValue FLOAT
) timestamp(timestamp) PARTITION BY MONTH WAL
WITH maxUncommittedRows=500000, o3MaxLag=600000000us;
select timestamp,propId,first(propValue) ,max(maxValue) ,min(minValue),avg(avgValue) from sys_telemetry
where (propId=1 or propId=2 or propId=3 or propId=4 or propId=5 or propId=6) and timestamp in '2024'
SAMPLE by 1M
There are approximately 800 million pieces of data.
When “propId” is of the Int type, the first query takes approximately 5 seconds.
After I changed the “propId” to the “symbol” type, the query time was set to be longer. Why is that? I have tried setting “propId(symbol)” as the index, but the result was still not satisfactory.
I believe that the “symbol” type should be able to indicate the query efficiency.But it doesn’t seem to be working now.