MySQL Auto-Deletion of Tables

After setting a data retention period, data tables in MySQL (such as historian.sqlt_data_3_2025_08) will be automatically deleted upon expiration. I would like to ask whether, after deletion, a table with the same name will also be automatically deleted in the future, or if it's possible to set rules to prevent a specific table from being deleted.

I would expect the tables to be deleted - but don't know for sure.
What's the real problem you're trying to solve?

1 Like

The pruning process for historical data does not maintain a record of known tables or anything else "internally" - the only source of truth the SQL historian uses is your SQL database.
So if you have a range of time covered by a partition in sqlth_drv that is outside your prune settings, the tag historian will actively attempt to drop that table if it exists.

Thank you for your reply. If I delete the corresponding row for a pname in sqlth_partitions, does that mean the table itself won't be deleted? Would this action affect the normal usage of the Ignition software?

Not if it is created manually, outside of Ignition.

Correct. Table should not be deleted.

Yes, Ignition should not attempt to read or write to this table at all.
Modifying these tables manually, outside of Ignition, without Inductive Support providing guidance, leaves a lot to be desired.

What is your end goal? Try to come up with a solution that won’t frustrate whomever might maintain the system after you.
Perhaps querying for data (within Ignition), then storing to a new history provider (within Ignition) would be a solution to storing specific data for longer periods?

1 Like

Can't underscore this enough.

What is the reason for using the historian, enabling pruning in the historian, then attempting to circumvent the pruning?

If you want to store data in some specific format/in some specific tables, use transaction groups or script the data entry yourself - don't try to abuse the historian to do this for you.

5 Likes