l Re-execute query each time then count/discard (simple but expensive)
n works well for small results sets or where users rarely view many pages
n fast initial response, degrades gradually for later pages
n count/discard in server is better but still inefficient for large result sets
n affected by inserts and deletes from other processes
l Re-execute query with where clause using min/max keys from last results
n works well where original query can be qualified in that way, not common
l Select and cache full result rows somewhere for fast access
n can be expensive for large result sets with big fields
l Select and cache only the row keys, fetch full rows as needed
n optimisation of above, use ROWID if supported, "select … where … in (…)"
l If data is static and queries predictable then custom pre-built indexes may be
useful
l The cache can be on web server, using DBM file for example, or on database
server using a table keyed by session id