Hi,
it seems very important to understand measurement, Tag Set and Field Set, how they interact with flux and the concept of Tables in InfluxDB. This is because correct understanding of the database is needed to structure your queries in an efficient manner.
When I do a query in flux that looks like this:
I group by _field, which means that each individual counter is in a separate table, because the Tag Set includes the _field as part of the grouping. If we have two counters, then there are two tables. This is shown in the InfluxDB response with table = 0 and table = 1:
So far, so good.
Then if I have an empty Group Key, then I am not grouping by anything and so all the data (that complies with the filter statements) should be output in one table. Here is the query:
This means there should be one table:
But it clearly shows that there is more than one table, which means that these two counters I selected are either combined together, which I did not want or I am misunderstanding something in the output.
In the flux language on this page, it explains that if you do not group by _field:
Then both fields will be in one table (albeit grouped by other criteria):
Does my second flux query really result in two tables? And if yes, why does it seem to contravene what the Influx example above states? How can I make sure I have got multiple fields into one table’s Field Set?
Many thanks,
Matthew.