We have created an element templated called "Phase Template". Within the template, we create the following attribute, formula and Pi point
CurrentValue - TimeMethod=AtOrBefore;RelativeTime=*;UOM=A
PreviousValue - TimeMethod=AtOrBefore;RelativeTime=*-1h;UOM=A
Overloaded - A=CurrentValue;B=PreviousValue;C=Threshold;[if A>C and B>C then 1 else 0]
Substation - [An Integer Number]
Threshold - [A Double Number]
Timestamp - [A DateTime]
We have created a .NET program to retrieve list of AF Elements which fulfills some criteria. The query is as follows:
Our .NET programs run every 30 minutes(and eventually run every 15 minutes), but we found that the SQL sever uses up 100% CPU. It is suspected that when AF issue query to SQL and the query might be expensive to run in SQL server.
Since we have 40000 elements in AF(we intend to add up to 120,000 elements), is there any method to improve the performance of SQL query issued by AF?
Thanks in advance.