While I was testing for #616 I ran into some really awful performance with pagination. The root cause is that H2 is taking a long time on queries, but the fact that the "count" and "page" members in Paginator are defs means that I was hitting the slow query multiple times for each render (8 times for "count" in my read of the code). I was wondering if we should go optionally cache the result of "page" in a RequestVar and base "count" on that to avoid hitting the database so many times. Yes, DBs have query caches and other things that should mitigate this, but still that's at least 8 round trips to the database for every page view.
Per DPP this should use a TransientRequestVar
Imported from Assembla: http://www.assembla.com/spaces/liftweb/tickets/868