Entity Framework troubleshooting and performance
I'm starting a whole series of blog posts on the use of
Entity Framework and the evil it can do to your database without you knowing it.
Your DBA will probably look at some of the queries that LINQ to Entities
executes and will take a big gulp. They are some of the worst queries that
I've come across.
The challenge is knowing how your Entity Framework model and your LINQ
queries are affecting the final queries that get fired at the database. This set
of posts will hopefully help you out so you know what to look for in your code
that is causing a really guly JOIN clause or a set of nested derived
tables.
This post will act like an index to all those posts, this is the list I hope
to post,
1. Non-Primary-Key column(s) [????] are being mapped in both fragments to
different conceptual
2. The impact of joining on non PK columns.
3. Should you define associations in the model or not
4. Impact of compile time of LINQ to Entities queries
5. Literals in LINQ to Entities queries
6. How parameter naming in LINQ to Entities is really bad for
performance
7. The impact of parameter lengths with LINQ to Entities queries
If you have any comments on which of these to focus on, then let me know and
I will prioritise them.