It you want to limit query result, just use an universal method limitBy(int limit).
The code returns first 5 records:
Pagination - another form of limit.
Gets page no 2 where there are 30 records visible on page. It might be also replaced by limitBy(60,30)