title: Pagination - Get all items from DB and then paginate, or get "pages" of items?
body: <p>I'm currently developing a Zend Framework project, using Doctrine as ORM.</p>
  
  <p>I ran into the typical situation where you have to show a list of items (around 400) in a table, and of course, I don't want to show them all at once.
  I've already used <a href="http://framework.zend.com/manual/en/zend.paginator.usage.html" rel="nofollow">Zend_Paginator</a> before (only some basic usage), but i always used to get all the items from the DB, and then paginate them, but now it doesn't feel quite right.</p>
  
  <p>My question is this: is it better to get <strong>all items</strong> from DB first and then "paginate" them, or to get <strong>"pages" of items</strong> as they are requested? which would have a larger impact on performance?</p>