I have a table of 200,000 record where I am getting only the top 10 using .Take()
but it is taking about 10 seconds to get the data.
My question is: does the .Take()
method get all the data from the database and filter the top 10 on the client side?
Here is my code:
mylist = (from mytable in db.spdata().OrderByDescending(f => f.Weight)
group feed by mytable.id into g
select g.FirstOrDefault()).Take(10).ToList();
spdata()
is a function Import from stored procedure.
Thanks