9
votes

I want to optimized my queries in Entity Framework 6.1.3, so I need to know that whether queries are already CompiledQueries or I need to write them manually as CompiledQuery?

Thanks in advance.

1
What are compiled queries? - vivek
Say what?! You must referring to cached execution but that is up to the database engine. - MeTitus
The CompiledQuery class provides compilation and caching of queries for reuse. for more details you can visit this link: msdn.microsoft.com/en-us/library/bb896297(v=vs.100).aspx - Aashish Kumar

1 Answers

4
votes

No, they are not. You'll need to specify that you want to use a CompiledQuery.

That said, using a compiled query will only provide a 7% performance improvement. If tuning performance of EF really is a major issue for you, I recommend reading the following:

https://msdn.microsoft.com/en-us/data/hh949853