mPIPoints = srv.GetPointsSQL("Tag='" & tag & "'") 'around 100000 pipoint
foreach mPIPoint as PIPoint in mPIPoints
How can I enhance the Data.RecrodedValues performance?
I suggest using asynchronous calling. Create N=4+ PIAsynchStatus objects (depending on expected client/server capacity) and leverage the concurrency built into the PISDK and PI Server. Modify the foreach loop to call only when N PIPoint objects are identified, then call and start the next call when you have a free asynchronous object.
Does anyone have a favorite algorithm? (I know some of you do)
See here: [DEAD LINK] vcampus.osisoft.com/.../3810.aspx
to get some ideas about the algorithm :-)
As discussed in other discussion threads, you might want to look for Rich Data Access when it makes its way to AF SDK, in the 2012 version. In the meantime, follow Charlie and Andreas' advices
However, we need to use Archived value but not the interpolated values.
Does Asynchronous Summaries could return the archived values?
What Charlie and Andreas shared is solely the ideas around asynchronous calling; then you can use the methods you want to retrieve data (which that support asynchronous calling). PIData.RecordedValues is one the methods that do support asynchronous calling.
I suggest you look into the PI SDK Programming Reference for more information on using the PIAsynchStatus object and the complete list of methods that support asynchronous calling. Give this a try and don't hesitate to post any questions you may have down the road!
Retrieving data ...