title: Nhibernate Paging performance on large table (10,000,000 rows)
body: <p>I have a table that is rather large at about 10,000,000 rows.  I need to page through this table from my C# application.  I'm using NHibernate.  I have tried to use this code example:</p>
  
  <pre><code>return session.CreateCriteria(typeof(T))
                  .SetFirstResult(startId)
                  .SetMaxResults(pageSize)
                  .List&lt;T&gt;();
  </code></pre>
  
  <p>When I execute it the operation eventually times out if my startId is greater than 7,000,000.  The pageSize I'm using is 200.  I have used this method on much smaller tables, of less than 1000 rows, and it works and performs quickly.</p>
  
  <p>Question is, on such a large table is there a better way to accomplish this using NHibernate?</p>