Tag History SQL - Best practice Advice

Ive selected about 15 tags to log in the historian, ive noticed in the table it populates it as tagid 1,2,3,4,5 etc with the timestamp, is there anyway to configure this so that it doesnt log so many rows of the same timestamp?

Ive done it through a transaction group which was neater, is this the best way to do it? If so should i turn off the history enabled option in tag properties and let the transaction group do it?

If i change the sample rate to 'on change' i create a chart of tag 'P' between time range A and B, i create this chart i have another tag C i need to fill in as part of the report which didnt change during the points A and B how would i get the value of C to show in that chart?

It isn't logging multiple points at the same timestamp. I'm guessing you have combined "As Stored" (returnSize=-1) with a "Wide" return format. The appearance of duplicated data points is documented behavior for this combination. The historian doesn't log multiple points in groups with identical timestamps--each point gets recorded separated, likely with small (milliseconds) deltas with other samples. When pulled into wide format, the timestamps are different for each point, and there's no simple solution.

Solutions to consider:

  • Don't use as-stored. Let the historian aggregate or interpolate each result row.

  • Don't use wide format. Tall format will yield true as-stored data points.

  • Don't use the historian when you need synchronized recording of correlated data. That's what transaction groups are for (or scripted equivalents).

A few good links that may help draw a clearer picture.

https://docs.inductiveautomation.com/display/DOC81/Ignition+Database+Table+Reference

https://docs.inductiveautomation.com/display/DOC81/How+the+Tag+Historian+System+Works