Is SQL Server caching LINQ to SQL queries?

As far as I know, in MS SQL Server 2000+ compiled stored procedures work faster than regular uncompiled queries. Interestingly, MS MS SQL Server also compiles LINQ to SQL queries and caches this compilation for performance purposes.

+3
source share
5 answers

When it comes to the SQL Server execution plan, there are no significant speed differences with stored procedures and regular uncompiled queries. See this for more information on other speed factors.

LINQ-to-SQL generates normal paramatized queries (SQL Server knows nothing about LINQ, the application generates normal SQL), so the balance is the same. That is, if you are not using LINQ-to-SQL functions that invoke Stored Procs (assuming that you had in mind the query material).

You can also read this , which is a similar question, but focuses on the more important benefits of LINQ vs StoredProcs

+3
source

SQL Server does not know about LINQ.

As far as I know, LINQ works like a library that uses queries to generate SQL queries, which are then sent to the server as SQL text commands.

+2
source

, SQL Server. LINQ to SQL, .

+1

MS SQL Server TSQL, . , . , , dba.

, MS SQL Server 2000 , . . ( SQL Server 2000 +).

+1

CompiledQueries LinQ SQL Server, . LinQ SQL Server.

.

LinQ LinQ.

, , SQL-, , , LinQ .

PS. SQL Server : DBCC DROPCLEANBUFFERS

, LinQ .

LinQ , . LinQ. SQL Server , .

, , .

+1

Source: https://habr.com/ru/post/1705089/


All Articles