Rico's statement "Each execution builds the expression tree, and then builds the required SQL." is talking about turning a LINQ expression tree into a SQL string before SQL Server ever gets a chance to reach into its query cache.
Jeff's conclusion "The computational cost of pre-processing a given query is only paid the first time the database sees the new query....Not so in Linq to SQL." is just plain talking about the wrong thing.
SQL Server doesn't care what abstraction generated the SQL query that it's receiving, it'll still use the same old cache.
Rico is legitimately discussing the time taken for the web server to compile a query to SQL, not the time for a SQL Server to look up a cached or uncached query.
"In short the problem is that the basic Linq construction (we don’t really have to reach for a complex query to illustrate) results in repeated evaluations of the query if you ran the query more than once."
It sounds to me like Rico is advocating the prepare/execute model. With ODBC, it's possible to generate a query plan on the client side. What Rico is saying is that it generates a query and then sends the raw query to the database. This would have been a valid point before SQL Server 2005, but according to Microsoft "the prepare/execute model has no significant performance advantage over direct execution, because of the way SQL Server reuses execution plans."
I was a bit confused about this as well. The DB builds a query plan from the SQL. Linq builds an SQL query, so they're two parts in a chain, not interchangeable.
The confusion seems to come from "preprocessing" the query twice. LINQ adds another layer of preprocessing.
Rico's statement "Each execution builds the expression tree, and then builds the required SQL." is talking about turning a LINQ expression tree into a SQL string before SQL Server ever gets a chance to reach into its query cache.
Jeff's conclusion "The computational cost of pre-processing a given query is only paid the first time the database sees the new query....Not so in Linq to SQL." is just plain talking about the wrong thing.
SQL Server doesn't care what abstraction generated the SQL query that it's receiving, it'll still use the same old cache.
Rico is legitimately discussing the time taken for the web server to compile a query to SQL, not the time for a SQL Server to look up a cached or uncached query.