# Tags with hundreds of tag ids

**URL:** <https://forum.inductiveautomation.com/t/tags-with-hundreds-of-tag-ids/22261>\
**Category:** Ignition\
**Created:** [January 31, 2019, 5:22pm UTC](https://forum.inductiveautomation.com/t/tags-with-hundreds-of-tag-ids/22261 "2019-01-31T17:22:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![salbrechtsen](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/salbrechtsen/32/18660_2.png) [@salbrechtsen](https://forum.inductiveautomation.com/u/salbrechtsen)\
**Post date:** [January 31, 2019, 5:22pm UTC](https://forum.inductiveautomation.com/t/tags-with-hundreds-of-tag-ids/22261/1 "2019-01-31T17:22:07Z")

</div>

In my sqlth\_te table I have one tag with 767 tag ids and 46 with 450+ tag ids. The remaining tens of thousands of tags have less than 10.

This is causing some tag history queries to take 5-10 minutes to run and causing DB connections to run out etc.

What steps can be taken to consolidate these tag ids?

---

<div class="post-metadata">

**Author:** ![salbrechtsen](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/salbrechtsen/32/18660_2.png) [@salbrechtsen](https://forum.inductiveautomation.com/u/salbrechtsen)\
**Post date:** [February 4, 2019, 3:58pm UTC](https://forum.inductiveautomation.com/t/tags-with-hundreds-of-tag-ids/22261/2 "2019-02-04T15:58:16Z")

</div>

I’m mostly wondering what causes tags to be “retired” and new ids created. It would also be great if there was a way to consolidate these.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 4, 2019, 4:02pm UTC](https://forum.inductiveautomation.com/t/tags-with-hundreds-of-tag-ids/22261/3 "2019-02-04T16:02:25Z")

</div>

Are you regularly reconfiguring these tags? Via scripting, perhaps?

---

<div class="post-metadata">

**Author:** ![salbrechtsen](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/salbrechtsen/32/18660_2.png) [@salbrechtsen](https://forum.inductiveautomation.com/u/salbrechtsen)\
**Post date:** [February 4, 2019, 4:14pm UTC](https://forum.inductiveautomation.com/t/tags-with-hundreds-of-tag-ids/22261/4 "2019-02-04T16:14:38Z")

</div>

A little bit, certainly not 700 times. We have around 100,000 tags on this gateway. Only these ~40 ish tags are very high. The remaining 90,060~ have 40 or less tag ids with 90%+ under 10 tag ids.
