I’m new to ignition, but it seems like the sqlt_data table structure is very inefficient…space for an int, a float, a string, and a date value in every single row, even if you’re only wanting to store (for instance) a float.
https://docs.inductiveautomation.com/pages/viewpage.action?pageId=4065915
Am I missing something here? Is there a way to store the different data types in different tables to save on space?
You are free to write data to a table(s) of your own design.
How? I understand I can write data to a differnt table in the general course of writing code, but can I do that when I just want to turn on the built-in “History Enabled” feature?
Well im not an expert on db storage efficiency, but if you don’t like how the historian does things, why not do it yourself?
https://docs.inductiveautomation.com/display/DOC81/system.db
For example, i do this for power meter logging. I only care about one value and only need it every 15 min so i created a gateway scheduled script that runs every 15 min and writes the data using system.db.runPrepUpdate
Nulls are stored very efficiently (effectively zero space) in all modern databases. Don’t worry about the unused columns.
If you store very much data based on time instead of change, you should use custom wide tables instead of the Tag Historian. (Transaction Groups in the SQL Bridge module if you want drag-n-drop convenience.)
Search this forum for tall versus wide for more discussions.
3 Likes