Is a full list returned first and then filtered when using linq to sql to filter data from a databas

Posted by RJ on Stack Overflow See other posts from Stack Overflow or by RJ
Published on 2010-05-11T14:15:30Z Indexed on 2010/05/11 14:24 UTC
Read the original article Hit count: 192

Filed under:
|
|

This is probably a very simple question that I am working through in an MVC project. Here's an example of what I am talking about.

I have an rdml file linked to a database with a table called Users that has 500,000 rows. But I only want to find the Users who were entered on 5/7/2010. So let's say I do this in my UserRepository:

from u in db.GetUsers() where u.CreatedDate = "5/7/2010" select u
(doing this from memory so don't kill me if my syntax is a little off, it's the concept I am looking for)

Does this statement first return all 500,000 rows and then filter it or does it only bring back the filtered list?

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about linq-to-sql