title: Pagination Strategies for Complex (slow) Datasets
body: <p>What are some of the strategies being used for pagination of data sets that involve complex queries?  count(*) takes ~1.5 sec so we don't want to hit the DB for every page view.  Currently there are ~45k rows returned by this query.</p>
  
  <p>Here are some of the approaches I've considered:</p>
  
  <ul>
  <li>Cache the row count and update it every X minutes</li>
  <li>Limit (and offset) the rows counted to 41 (for example) and display the page picker as "1 2 3 4 ..."; then recompute if anyone actually goes to page 4 and display "... 3 4 5 6 7 ..."</li>
  <li>Get the row count once and store it in the user's session</li>
  <li>Get rid of the page picker and just have a "Next Page" link</li>
  </ul>