# Performance difference between measure name and tags

**URL:** <https://community.influxdata.com/t/performance-difference-between-measure-name-and-tags/13246>\
**Category:** Store\
**Tags:** influxdb, time-series, query\
**Created:** [February 28, 2020, 7:52pm UTC](https://community.influxdata.com/t/performance-difference-between-measure-name-and-tags/13246 "2020-02-28T19:52:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkarchmer](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/dkarchmer/32/4096_2.png) [@dkarchmer](https://community.influxdata.com/u/dkarchmer)\
**Post date:** [February 28, 2020, 7:52pm UTC](https://community.influxdata.com/t/performance-difference-between-measure-name-and-tags/13246/1 "2020-02-28T19:52:53Z")

</div>

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

Vs

- 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:

```auto
SELECT "value" FROM "db1"."autogen"."data.org1.global.5051" 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:

```auto
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

```auto
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

---

<div class="post-metadata">

**Author:** ![Mark\_Best](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/mark_best/32/4521_2.png) [@Mark\_Best](https://community.influxdata.com/u/Mark_Best)\
**Post date:** [March 24, 2020, 11:54am UTC](https://community.influxdata.com/t/performance-difference-between-measure-name-and-tags/13246/2 "2020-03-24T11:54:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [March 24, 2020, 6:41pm UTC](https://community.influxdata.com/t/performance-difference-between-measure-name-and-tags/13246/3 "2020-03-24T18:41:18Z")

</div>

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