> Any suggestions on how to get the count of all records that could be
> returned
We use a window function to get the total # of records within each of
our paginated queries:
SELECT
...
,COUNT(*) OVER() fullRowCount
FROM ...
WHERE ...
ORDER BY ...
LIMIT ... OFFSET ...;
While there is a cost to using the window function, it's faster (for
us) than two separate queries, and, more importantly, it's flexible
enough to work in the 100s of different query contexts we have.
/mcr