Kati Iceva, the gal I know as the brains behind query compilation for Entity Framework (though she may have some partners in crime) has written a great blog post laying out some of the improvements to query generation in EF4.
Improvements to the Generated SQL in .NET 4.0 Beta1
Kati explains 7 major changes in detail with before & after examples and lists an additional set of changes we will see after Beta 1.
Here is my abbreviated version of the changes she lays out:
- More efficient nested queries
- Eliminated unnecessary Is Null checks in LINQ to Entities queries
- Bye bye to some of the crazy LEFT OUTER JOINs
- Streamlining nested ORs with IN
- Support for more variations on LINQ’s GROUP BY operator
- Stop Casting 1 to a bit of 1
- Greatly simplifying queries against hierarchical entities
Her additional list of upcoming changes has two which I want to highlight because after SQL MVP, Adam Machanic, pointed this out to me, he and I lobbied hard for a fix.
Entity SQL does have a LIKE statement and I have recommended frequently that people use it instead of the above functions if they care about database performance.
If *you* care about your database performance, don’t miss this blog post.
Note that Kati points out which improvements only impact SqlClient and which are in the query pipeline and will help all providers.




