Hello. I am using InfluxDB 1.8.3. I have a schema as such:
time | y1| y2 | x | index | mac
where y1, y2 and x are fields and index and mac are tags. There are multiple entries for the same mac and timestamp but with different indexes. To ensure that I am able to plot the x values in the correct order on Grafana, the index values are not assigned in ascending order like the x values, i.e.
x | index
0 0
1 1
2 2
3 3
The index values are instead sorted as strings and then assigned which leads to the following ordering,
time | y1| y2 | x | index | mac
111 33 35 0 0 AABBCC001122
111 40 30 1 99 AABBCC001122
111 65 20 2 98 AABBCC001122
111 93 19 3 97 AABBCC001122
I have no issues when I have just one such set in the database. However, when I add another set of data with a different timestamp or mac tag, the two sets do not maintain the index ordering and become jumbled up, causing the x values to also not maintain the ascending order. The ordering is restored when I query to get just 1 set of data of any particular mac but the problem resurfaces when I query for either multiple sets from one mac in a time range or multiple sets from several macs. Any reason why the index tag ordering would mess up?
For a better understanding, the following image show the line graph of x against y1 using plotly.
The first image show the graph of just 1 set of data from 1 mac. The line is smooth because the x values are in order. The second image shows the graph of 2 sets of data with 2 different timestamps from 1 mac. The line is all over the place because the x values are not in order due to the index ordering also changing.