I am using a Time Series chart to display tag history information. The users would like to be able to see a wide time range as they look for anomalies, then zoom in with more data points for a better idea of what's going on in the process.
Using system.tag.queryTagHistory - I set the intervalSeconds and returnSize based on the length of time between the selected start and end dates, and the aggregationMode = 'MinMax', but I just found out when I tried to get a range of three days, with a few tags selected, the processor was almost maxed and the queries were taking one to four minutes - according to the logs, and I never got the data charted.
All the items are pretty much scripted, from a root.custom.pens object, to the chart's series and trends.
I'm curious if there is a better way to pull tag history with custom return sizes or intervals that is less processor intensive.
Well, what you are requiring does not seem crazy at all, so normally, it should be very fast for data of just a few days. It's starts getting slow for a month of data mostly, so I would look into your hardware and network, to see if there is an issue there.
Consider adding additional logging within your scripts. Ensure you're correctly limiting the number of queries / minute, limiting the number of points returned, etc.
You might also experiment with the PowerChart (which has this functionality baked-in) to compare results with your approach.