Home > Back-end > Delphi7 query SQL Server2008 efficiency problem
Delphi7 query SQL Server2008 efficiency problem
Time:09-16
Recently wrote a program about sql2008 data query, which encountered a few problems, do not know how to start, a great god, please give directions I'm through TADOConnection component with SQL Server, through the TADOQuery component data access, write SQL query language, database table is very simple, only one table, the table has ID, timestamp, and more than 20 strings, each not more than 10 characters, there are about 15 g database, the database tables is not my, and has been used cannot be changed, My goal is to remove abnormal changes in the database data, and then judge the abnormal changes of what belongs to Every time I currently take out 1 w data (dare not to add the query conditions, because the abnormal changes of data is not regular, sometimes a check is ages), then through the algorithm I wrote a quick judgment, Problem: Article 1, a single query 1 w data only it takes about 140 milliseconds, but when continuous take (also known as access - algorithm when the judge - access - algorithm to judge) several times after the access time becomes 2-3 seconds, don't know what reason, I am by ID query, Feign death, when I was 2, the query Internet along while, it should start another thread for (I am now writing in the timer control), haven't tried don't know can't solve, Is there a more efficient way to query? 3, the execution time of the algorithm is a little long, and every CPU utilization from 50% to 80%, don't know why, I'm from inside the TADOQuery read a is a, then next again next, checked the, it should be placed in an array, haven't tried, don't know is for this reason, the Above is I encountered several problems, please supervise your great god help me to answer it,
CodePudding user response:
The change of the data sheet if you need very high efficiency, better real-time requirements, generally should not be set in the program, in the database are suggested to create a stored procedure, using the data update trigger event notification program
Use your algorithm, I am a database administrator, I'll direct your IP DROP the
CodePudding user response:
Database is not updated, it is already recorded data, and database I don't have permission to change the==,