Performance difference between measure name and tags

I have an IoT application where all data comes from the different sensors with a standard payload where all that changes is the variable ID which is a four digit hex string.

I currently use something like data.varID as my measurement name. The varID is also a tag, even if redundant. But this is somewhat inconvenient as some times I want to be able to easily query data across more than one varID.

I have tried to find the answer to this question but cannot find it: what’s the difference between

  • having lots of data.varID measurements


  • have a single data measurement with varID as a tag

As I understand, both would be equivalent in terms of the number of time series in the database so is there any other consideration?

The types of queries I usually need are simple:

SELECT "value" FROM "db1"."autogen"."" WHERE time > now() - 24h AND ("device"='d--0000-0000-0000-0acf' OR "device"='d--0000-0000-0000-0ace')

so basically getting data for a given variable across devices for a period of time. But in some cases, I also want to get more that one variable at a time, which is why I would like to instead do something like:

SELECT "value" FROM "db1"."autogen"."data.org1" WHERE time > now() - 24h AND ("device"='d--0000-0000-0000-0acf' OR "device"='d--0000-0000-0000-0ace') AND ("variable"="5051") AND ("variable"="5052")

or maybe

SELECT "value" FROM "db1"."autogen"."data.org1" WHERE time > now() - 24h AND ("device"='d--0000-0000-0000-0acf' AND "variable"="5051) OR ("device"='d--0000-0000-0000-0ace' AND "variable"="5052")

but at this time, I would be putting everything on a single measurement, with “device”, “variable” (and a couple other things) as tags.

So, is there any consideration I need to consider before switching to having a single measurement for my whole database and only rely on tags for making the different actual time serieses

did you manage to work out the answer to this? I have a very similar problem to this at the moment.
Regards, Mark

I can’t think of anything. Your plan to switch to a single measurement is a good one. Always load your tags first.