rewrite of query paging so as not to have quadratic performance when
fetching more pages.