I'm not super familiar with Linq to SQL yet but something that strikes me is that this:
var articles =
(from a in DB.Articles
where
a.ArticleId == ArticleId.Question &&
a.DeletedAt == null &&
a.Votes >= minVotes
orderby a.UpdatedAt descending
select a).
Take(maxarticles);
gets translated to this:
string query =
"select top 10 * from articles
where
ArticleId = 1 and
DeletedAt is null and
Votes >= -5
order by UpdatedAt desc";
It strikes me as inefficient that linq to sql is willing to vacuum up everything using a "select *" type of query. Isn't this inefficient?
Why does linq to sql do it this way?