# How to purge old tag history data

**URL:** <https://forum.inductiveautomation.com/t/how-to-purge-old-tag-history-data/102079>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [February 10, 2025, 3:02am UTC](https://forum.inductiveautomation.com/t/how-to-purge-old-tag-history-data/102079 "2025-02-10T03:02:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lion\_Sun](https://avatars.discourse-cdn.com/v4/letter/l/3ab097/32.png) [@Lion\_Sun](https://forum.inductiveautomation.com/u/Lion_Sun)\
**Post date:** [February 10, 2025, 3:02am UTC](https://forum.inductiveautomation.com/t/how-to-purge-old-tag-history-data/102079/1 "2025-02-10T03:02:17Z")

</div>

There are many database tables (by monthly partition) which contains the tag history data, the tables are named as `sqlt_data_{driverId}_{year}_{month}`. As time passed away, I want to purge the tables which are over 12 months ago. My question is: Can I just manually delete these old tables use `DROP TABLE sqlt_data_{driverId}_{year}_{month}` ？ I noticed all monthly partition tables' name are contained in another table `sqlth_partitions`. Is it necessary to also update this table (delete the rows) at same time?

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [February 10, 2025, 3:06am UTC](https://forum.inductiveautomation.com/t/how-to-purge-old-tag-history-data/102079/2 "2025-02-10T03:06:06Z")

</div>

Use the data pruning function in the history tag settings.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/5/45b7b480fb94c66bc905b654b86bab5364a52216.png)

Don't do this pruning manually, its a hazardous exercise.

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [February 10, 2025, 3:23am UTC](https://forum.inductiveautomation.com/t/how-to-purge-old-tag-history-data/102079/4 "2025-02-10T03:23:25Z")

</div>

You have not enabled the pruning. If you don't enable it, it will not delete data.

---

<div class="post-metadata">

**Author:** ![Lion\_Sun](https://avatars.discourse-cdn.com/v4/letter/l/3ab097/32.png) [@Lion\_Sun](https://forum.inductiveautomation.com/u/Lion_Sun)\
**Post date:** [February 10, 2025, 3:23am UTC](https://forum.inductiveautomation.com/t/how-to-purge-old-tag-history-data/102079/5 "2025-02-10T03:23:51Z")

</div>

Thank you David!
