Custom MySQL Table Settings with Tag Historian

I am using the tag historian module with a local MySQL database to store multiple float values. When the tag historian creates a table to store tag history the column for float values is of type double. I assume this is so any size of float/double can be stored in this column (similarly the int column has the bigint datatype). I would like to make this column type a float to prevent extra decimals being added to my values and reduce storage size; I can do this by altering the table settings directly but I would have to do this for each partition as it is created. Is it possible to modify the default settings of these tables in the tag historian?

I want to say you can’t, but i don’t know that for certain. If it were possible i am thinking it would involve modifying the internal db, which could be dangerous.

Some alternative ideas that might be of interest: You could disable partitioning and then modify the data types, that obviously isn’t a good idea if you are logging a huge amount of data. You could also log the data directly to tables of your own creation with the system.db functions.

You could accomplish this by changing the precision of the MySQL translator’s double column to use a different SQL literal. I would not recommend it, though. For one, it’ll affect all MySQL connections you have (unless you create a duplicate translator entry). For another, it’ll affect all sources of Ignition generated tables that store double data (such as transaction groups). For a third, it’s probably not going to make as much practical difference in storage size as you want, while being a significant loss of precision.

1 Like

OK I suspected something along these lines would be possible. For now this is my only MySQL connection but I will likely be adding more so I will hold off on any changes. Thanks for your help.