Say something about the SQL Server execution plan, first of all I'm not a DBA, and I've done some things about SQL optimization in the last few years, and there's something that I understand, and that's not necessarily true. The difference between the T-SQL statement and the stored procedure passed from the application first is that SQL Server compiles it once, and the stored procedure is compiled, and executes without having to compile again, which is equal to a compilation of multiple executions. The resulting SQL statement, if not a parameterized query, would generate different execution plans, with a chestnut: SELECT * FROM dbo. Employee WHERE ID = 1 and SELECT * FROM dbo. The Employee WHERE ID = 2 generates two execution plans, which means that the condition is also deposited as a statement into the execution plan, and if it is changed to a parameterized query, it will produce only one execution plan, and the next time the access is directly reused, the project has encountered once before, because it is the old project, all of which are splicing SQL in the program. Long time to find clear data is not small query but to execute long, through tracking only to find that the original is the execution Plan storage table is too large, resulting in each access to take the corresponding execution plan, resulting in a waste of performance.
SQL Server execution Plan generation method