Historian data partitioning table name format

Hey all,

For our historian database, we have data partitioning configured to create a new table every month. We are querying this externally (PowerBI), and need to dynamically select the appropriate table based on month/year the user is trying to see the report for.

I can see this format for the table names: sqlt_data_1_2022_09 and sqlt_data_1_2022_10

The year and month portions of the table name are straight forward, however I am not convinced the "1" preceding the year and month is a static value. The data partitioning video on Inductive university shows this as a "7" in that particular instance. Should I expect this "1" to change on me, and if so, under what conditions?

Thanks in advance,


The 1 corresponds to the 'driver ID'. See the sqlth_drv table. A given gateway will have at least two records in sqlth_drv - one with a null provider (the ID for that row will be used for the partition table), and one for each realtime tag provider storing history from that gateway.

An option to consider: if you use the WebDev module, you can create a REST API. You would then be able to use system.tag.queryTagHistory to abstract over the database implementation details.