I have following query with which I am trying to select top 10 values of measurement, along with another field in that measurement.
> SELECT top("value", 10), "auto_id" FROM "stat.series.log_book.computation" WHERE time >= 1518684004169ms and time <= 1518684121709ms ORDER BY time DESC
time top auto_id
---- --- -------
1518684005662000000 1.21402096748352 6182
1518684015269000000 1.2542519569397 6182
1518684024488000000 1.21754097938538 6182
1518684028575000000 0.888169050216675 6182
1518684034943000000 1.04962706565857 6182
1518684036717000000 0.870682954788208 6182
1518684041304000000 9.79708886146545 6182
1518684072901000000 1.25484204292297 6182
1518684095342000000 0.876681089401245 6182
1518684107811000000 1.19542217254639 6182
which looks fine until I look at the points returned like this:
> select time, auto_id, value from "stat.series.log_book.computation" WHERE time >= 1518684004169ms and time <= 1518684121709ms AND value > 0.87;
name: stat.series.log_book.computation
time auto_id value
---- ------- -----
1518684005662000000 8910 1.21402096748352
1518684015269000000 8910 1.2542519569397
1518684024488000000 8910 1.21754097938538
1518684028575000000 11583 0.888169050216675
1518684034943000000 1701 1.04962706565857
1518684036717000000 11583 0.870682954788208
1518684041304000000 7907 9.79708886146545
1518684072901000000 8920 1.25484204292297
1518684095342000000 11583 0.876681089401245
1518684107811000000 8910 1.19542217254639
This shows that the auto_id field in the top() query result is wrong. I am clearly missing something here. I want the result of the second query, but using the top function. Can this be achieved?