The recent project to do thousands of students to face recognition record (currently about 630000 lines) query the last record, it is conceivable that the performance of this piece is a problem. As a shen, get to SQL Server Profiler and Database Engine Tuning Advisor These two jobs are QI.
Start to install force ...
First, a SQL statement that performs less efficiently
Save trace files from SQL Server Profiler to Local
Open the Database optimization engine, select the workload file and the database/table that needs to be optimized, click Start Analysis
After the analysis will give you index suggestions, perform actions → application recommendations, will automatically generate SQL statements and execute, and then perform the test that inefficient SQL is now not fast a lot :)
Character a reference article: 51887638
SQL Optimization Tool-SQL Server Profiler and Database Engine Tuning Advisor