Compiled or Bust?

All subsequent runs of that same query use the cached query plan and skip the query evaluation. Not so in Linq to SQL. As Rico said, every single run of the Linq query is fully parsed every time it happens.

No, what Rico said has nothing to do with cached query plan. He said that in every single run, the Linq query expression has to be parsed and converted to SQL. This is all happening in the app, whereas the query plan resides in the db.

Like Shachart said, whether or not a cached query plan will be used is database dependant.

Also, when you use ORM, you always do “5000 batches of 1 selects”. No sane person will use ORM to do “1 batches of 5000 selects”. That’s why Rico concluded his blog post with this statement:

“In short, if you expect to reuse the query at all, there is no performance related reason not to compile it.”