[00:00]
In this video, we are going to talk about the data partitioning and pruning feature of the Tag Historian. By default, the Tag Historian system will partition data out into multiple tables. These partitions help keep the individual table size fairly small as a single table with a lot of records is usually pretty slow to query. So, by splitting up the data into these partitions we can keep most queries to the Tag Historian system pretty quick. The Tag Historian system also has the ability to turn on data pruning, where it will remove older records. These features can help you automatically manage the data in your tagged history system. And are configured in the configure section in the tag history page.
[01:01]
Here we can see my historical tag provider and to manage these features we simply need to edit the historical tag provider by clicking on the edit button on the right. I'm going to scroll down a little bit here and we can see this first section we have here is data partitioning. Like I said earlier, data partitioning is turned on by default. And it is set up to partition once a month. I'm going to briefly pull in my management studio so we could take a look at the tables in my database. We can see here I've got the tag history tables and there are two tables for data. One for September and one for October. If I were to store data in the month of November, then the system would have automatically created a third data table that ended in 11. Let's go back to our historical tag provider settings. Where I can see that not only can I change how often the Tag Historian system partitions my data, but I can also decide to turn partitioning off entirely.
[02:16]
I can also decide to take my partitioning one step further and use preprocessed partitions. When pre-process partitions are enabled, the Tag Historian system will actually create a second partition every time it makes one. This second partition is a summary of the data in the first partition. The data is summarized based on the window size that you set in this property down here. This means that the data is shrunk even further and the table made even smaller. This can help when querying data over a large period of time. Oftentimes when querying a large of data you don't need it to be quite as granular as your standard partition. Because the pre-process partition is a summary of that data and there is less of it, it can be queried and returned much quicker than if we were only querying the standard partitions.
[03:19]
Finally, you can also enable data pruning on your Tag Historian system. The data pruning system will automatically remove old data from the tag history system out of your database. The data pruning system works by removing older partitions not individual records of data. This means that the data pruning system will wait until an entire partitions worth of data is older than the prune age that you have set up here. Once the entire partition is past that prune age, then it will remove the entire partition as a whole rather than removing individual records from it. You can adjust the prune age here so that your data is kept for as long as you need it.