REST Pagination Calculator
Compare offset and cursor pagination cost across a large result set.
About REST Pagination Calculator
Offset pagination must count through every skipped row, so page 5,000 costs 5,000 times page one. Cursor pagination seeks on an indexed key and stays constant regardless of position. Offset pagination also skips or duplicates records when rows are inserted mid-traversal, so cursor pagination is more correct as well as faster.
Formula
REST Pagination
Offset scans offset + page size rows; cursor scans only page size rows
- offset
- Skips rows by counting through them, so cost grows with page number
- cursor
- Seeks directly using an indexed key, so cost is constant
Worked example
With the default values below, REST Pagination Calculator returns Offset Query Time at That Page of 500.000. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Total recordsminimum 1
- 1,000,000
- Page sizeminimum 1
- 50
- Cost per row scannedminimum 0 ms
- 0.002 ms
- Page number requestedminimum 1
- 5,000
Results
- Offset Query Time at That Page
- 500.000 ms
- Cursor Query Time at Any Page
- 0.1000 ms
- Total Pages
- 20,000
- Rows Scanned by Offset
- 250,000
- Cursor Speed Advantage
- 5,000.00 x
Step by step
- 1Values used
- 2REST Pagination
- 3Offset Query Time at That Page= 500.000 ms
- 4Cursor Query Time at Any Page= 0.1000 ms
- 5Total Pages= 20,000
- 6Rows Scanned by Offset= 250,000
- 7Cursor Speed Advantage= 5,000.00 x
Assumptions and limits
- The result is derived only from the 4 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax or compounding frequency into account.
- Figures are rounded for display to 4 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
How is REST Pagination calculated?
Offset scans offset + page size rows; cursor scans only page size rows Offset pagination must count through every skipped row, so page 5,000 costs 5,000 times page one. Cursor pagination seeks on an indexed key and stays constant regardless of position.
Why does REST Pagination matter?
Offset pagination also skips or duplicates records when rows are inserted mid-traversal, so cursor pagination is more correct as well as faster.
What values do I need to enter?
This calculator takes 4 inputs: Total records, Page size, Cost per row scanned, Page number requested. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.
Related Calculators
You might also need
- Elasticsearch Shard CalculatorCommonly used together
- Database Connection Pool CalculatorCommonly used together
- Redis Memory CalculatorCommonly used together
- Password GeneratorAlso in Developer & Networking
- Lighthouse Score CalculatorAlso in Developer & Networking
- 4K Streaming DataAlso in Developer & Networking
