increase query performance of pagination