title: If PostgreSQL count(*) is always slow how to paginate complex queries?
body: <p>If PostgreSQL's <code>count(*)</code> is <a href="http://wiki.postgresql.org/wiki/Slow_Counting" rel="noreferrer">always slow</a> how to paginate complex queries?</p>
  
  <p>Making triggers doesn't seem to be a good solution as long as in this case we have a lot of pages (for example different categories, filters, etc).</p>
  
  <p>What to do if <code>VACUUM/VACUUM ANALYZE/ANALYZE/VACUUM FULL</code> doesn't help? What are the best practices to use <code>count(*)</code> with postgresql?</p>