title: Fastest way to fetch huge amount of data from SQL Server database
body: <p>I have more than 50,000 records in the database which I have to deal with in my application (and the number is increasing by 2000/day as a minimum).</p>
  
  <p>The way I am currently using is: Linq to entities with a stored procedure in the database which is returning a collection of an object so that I can deal with it.</p>
  
  <p>But I noticed that it is a slow, what is the most efficient way to get such a number of records from the database? </p>
  
  <p>Sample of my code:</p>
  
  <pre><code>   items = (from f in db.spItems().OrderByDescending(f =&gt; f.date)
                    group f by f.ID into g
                    select g.FirstOrDefault()).Take(9).ToList();
                    join ar in db.anothertable on f.ID equals ar.ID
                    join t in db.thirdtable on ar.tid equals t.ID
  </code></pre>
  
  <p>spItems is a stored procedure which gets the results but sometimes i have to do multiple joins on it </p>