Sqlth_te maintenance - retired tags

Hi all,

I was doing some reading in the Ignition Database Table Reference and noticed that a tag can be retired for the following reasons.

  • The tag was deleted
  • The tag group on the tag was changed, which results in a new row being created with the updated scid
  • The tag was renamed

I ran a query to check how many of each I had.

SELECT count(*) FROM sqlth_te where retired IS NOT NULL 
~33000 tags
SELECT count(*) FROM sqlth_te where retired IS NULL 
~5000 tags

Looks like a lot of tags records can be deleted but I wanted to check to see if anyone has done this.

  • Should I periodically delete records that have a retired value?
  • Would I even gain anything by doing so?
  • What are the downsides of doing so?
  • Any other database tips I should be doing for this table or other Ignition tables?

Any historical data that had been stored prior to the tags being retired would no longer have a valid tagid. Generally if it is important that you keep historical data for a certain amount of time, I would recommend going through and updating the retired tagid’s with the new tagid’s prior to removing the retired tags.

You might see a small performance gain from shrinking the table size, and that would most likely be negligible. I don’t think there is anything else to gain.

I’m not sure of any other downsides to this.