# Key value with no series

**URL:** <https://community.influxdata.com/t/key-value-with-no-series/34119>\
**Category:** Systems\
**Created:** [May 2, 2024, 5:19pm UTC](https://community.influxdata.com/t/key-value-with-no-series/34119 "2024-05-02T17:19:41Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![halacs](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/halacs/32/15559_2.png) [@halacs](https://community.influxdata.com/u/halacs)\
**Post date:** [May 2, 2024, 5:19pm UTC](https://community.influxdata.com/t/key-value-with-no-series/34119/1 "2024-05-02T17:19:42Z")

</div>

Hi,

I’m trying to find out why below query results a list where few of the items are key values with no related series in my influxdb2 database.

Can anyone help me with this? I would like to drop that key value item out from the results: I’m using this query in Grafana for filtering purposes.

```auto
show tag values from "weather" with key = "device";

```

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![scott](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/scott/32/16492_2.png) [@scott](https://community.influxdata.com/u/scott)\
**Post date:** [May 2, 2024, 8:05pm UTC](https://community.influxdata.com/t/key-value-with-no-series/34119/2 "2024-05-02T20:05:46Z")

</div>

@halacs What version of InfluxDB are you using?

---

<div class="post-metadata">

**Author:** ![halacs](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/halacs/32/15559_2.png) [@halacs](https://community.influxdata.com/u/halacs)\
**Post date:** [May 2, 2024, 8:09pm UTC](https://community.influxdata.com/t/key-value-with-no-series/34119/3 "2024-05-02T20:09:45Z")

</div>

```auto
$ influx version
Influx CLI dev (git: a79a2a1b825867421d320428538f76a4c90aa34c) build_date: 2024-04-16T14:34:32Z

$ influxd version
InfluxDB v2.7.6 (git: 3c58c06206) build_date: 2024-04-12T21:51:21Z

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.4 LTS
Release: 22.04
Codename: jammy

```

---

<div class="post-metadata">

**Author:** ![scott](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/scott/32/16492_2.png) [@scott](https://community.influxdata.com/u/scott)\
**Post date:** [May 2, 2024, 8:18pm UTC](https://community.influxdata.com/t/key-value-with-no-series/34119/4 "2024-05-02T20:18:54Z")

</div>

I believe `show tag values` has a default time range that it will query for tag values. This particular query is pretty resource intensive because it has to query all data within the time range to identify what tag values exist. You could try including a `WHERE` clause with a custom time range, but just know that this may affect the overall performance of InfluxDB.

```sql
show tag values from "weather" with key = "device" where time > now() - 365d

```

---

<div class="post-metadata">

**Author:** ![halacs](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/halacs/32/15559_2.png) [@halacs](https://community.influxdata.com/u/halacs)\
**Post date:** [May 2, 2024, 8:39pm UTC](https://community.influxdata.com/t/key-value-with-no-series/34119/5 "2024-05-02T20:39:21Z")

</div>

Hi @scott ,

Do you know, in the below example, why `SzombathelyHatsoGarazs` is there if there is no series with `device=SzombathelyHatsoGarazs` at the second query in the selected database?

```auto
show tag values from "weather" with key = "device";

```

```auto
┃ 1┃device ┃SzombathelyHatsoGarazs ┃
┃ 2┃device ┃dolgozo ┃
┃ 3┃device ┃elso1 ┃
┃ 4┃device ┃foldszint1 ┃  

```

```auto
show series

```

```auto
┃ 29┃weather,device=dolgozo,id=BC:DD:C2:25:FB:02,sensor=BME280,topic=ostoros_tele_tasmota_25FB02_SENSOR,type=wemos ┃
┃ 30┃weather,device=dolgozo,id=BC:DD:C2:25:FB:02,topic=wemos_BC:DD:C2:25:FB:02_tele ┃
┃ 31┃weather,device=elso1,id=2C:F4:32:78:59:1F,sensor=BME280,topic=ostoros_tele_tasmota_78591F_SENSOR,type=wemos ┃
┃ 32┃weather,device=elso1,id=2C:F4:32:78:59:1F,topic=wemos_2C:F4:32:78:59:1F_tele ┃
┃ 33┃weather,device=foldszint1,id=2C:F4:32:78:71:7F,topic=wemos_2C:F4:32:78:71:7F_tele ┃
┃ 34┃weather,device=foldszint1,sensor=BME280,topic=ostoros_tele_tasmota_DFE42A_SENSOR,type=wemos ┃
┃ 35┃weather,device=foldszint1,sensor=BMP280,topic=ostoros_tele_tasmota_DFE42A_SENSOR,type=wemos                   

```

---

<div class="post-metadata">

**Author:** ![scott](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/scott/32/16492_2.png) [@scott](https://community.influxdata.com/u/scott)\
**Post date:** [May 2, 2024, 8:53pm UTC](https://community.influxdata.com/t/key-value-with-no-series/34119/6 "2024-05-02T20:53:19Z")

</div>

I’m wondering if all the points with the `SzombathelyHatsoGarazs` tag value aged out and your indexes haven’t updated yet. You could try [manually rebuilding your indexes](https://docs.influxdata.com/influxdb/v2/admin/internals/tsi/rebuild-index/) and see if it makes a difference.

---

<div class="post-metadata">

**Author:** ![halacs](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/halacs/32/15559_2.png) [@halacs](https://community.influxdata.com/u/halacs)\
**Post date:** [May 3, 2024, 5:53am UTC](https://community.influxdata.com/t/key-value-with-no-series/34119/7 "2024-05-03T05:53:33Z")

</div>

That helped, thanks a lot!

Do you know why indexes weren’t updated or how frequently should they be updated? Data was deleted months ago. I guess this is somehow a bug and manual index rebuild is a workaround for that. Am I right?

---

<div class="post-metadata">

**Author:** ![scott](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/scott/32/16492_2.png) [@scott](https://community.influxdata.com/u/scott)\
**Post date:** [May 4, 2024, 2:10am UTC](https://community.influxdata.com/t/key-value-with-no-series/34119/8 "2024-05-04T02:10:56Z")

</div>

I don’t know a ton about how the retention services (the service that removes expired data) interacts with indexes, but I’ve seen cases similar to this in the past. That’s all I really know.

---

<div class="post-metadata">

**Author:** ![halacs](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/halacs/32/15559_2.png) [@halacs](https://community.influxdata.com/u/halacs)\
**Post date:** [May 4, 2024, 6:05am UTC](https://community.influxdata.com/t/key-value-with-no-series/34119/9 "2024-05-04T06:05:18Z")

</div>

I see. Thanks a lot @scott !
