How can I be sure my LINQ expressions won't result in bad SQL?


Some LINQ expressions eventually end up as SQL statements against your database - and you can see this SQL if you're interested. In a few cases, the LINQ expression will result in SQL that doesn't perform well, or is just overly complex. Assuming we can control this to some degree by changing the LINQ expression or the schema of the data source, what can we do to optomize for performance and understandability?