When paging through data that comes from a DB, you need to know how many pages there will be to render the page jump controls.
Currently I do that by running the que
You could mitigate the performance penalty by not running the COUNT() query every time. Cache the number of pages for, say 5 minutes before the query is run again. Unless you're seeing a huge number of INSERTs, that should work just fine.