Engineering Lab

Performance Visualizer

Real-time benchmark comparing pagination strategies over a dataset of 10,000+ records. Watch offset-based performance degrade linearly while cursor-based stays constant.

10,000+ record dataset
limit=20 ยท 300 rows
Cursor (real API calls)
Offset (simulated scan overhead)

Why cursor pagination wins at depth

Cursor: WHERE id > ? LIMIT N

Index seek to the last-seen ID, scan forward N rows. Cost is O(N) regardless of how deep into the result set you are. Page 1 and page 100 take the same time.

Offset: OFFSET M LIMIT N

Database scans and discards M rows before returning N. Page 100 with limit 20 scans 2,000 rows to return 20. Cost grows linearly with page depth: O(M + N).