series-list: optimize generation of page links
series-list: optimize generation of page links

In the worst case, a SELECT COUNT(*) has to do the same table scan as the
actual query, while this is not true if the query has a LIMIT clause.
So, pass the query directly to gen_page_links and just print "..."
if there are more than 10 pages of results.  Then, after gen_page_links,
apply the order by clause for the final rendering of the results.

Signed-off-by: Paolo Bonzini <69d3ebcf5ee4e7f05a50dc23cd96655b730804b4@redhat.com>

patchew-project/patchew,patchew-project/patchew,patchew-project/patchew,patchew-project/patchew