Recommended Free Tools
Use cursor (keyset) pagination to move sequentially through a large or frequently changing collection, especially when deep-page query cost matters. Use offset pagination when people need numbered pages or direct jumps, provided the cost of skipping rows is acceptable. If your interface needs both, combine cursors for next/previous navigation with offsets for explicit page jumps.
How the two methods locate a page
Offset pagination counts from the beginning
An offset query asks for rows after skipping a specified number of rows, often with a limit for the page size. That maps naturally to numbered pages: page 20 is a position you can request directly. The trade-off is that the database may still process the skipped entries, and the work can grow as the offset gets larger. Microsoft’s Entity Framework Core pagination guidance describes this increasing work for skipped rows.
As an Amazon Associate I earn from qualifying purchases.
Cursor or keyset pagination continues from a boundary
Keyset pagination records the ordered values from the last row on the current page, then asks for rows beyond those values. An API may package that continuation position in an opaque cursor token or URL. With a suitable index, the database can seek from the boundary instead of repeatedly skipping a growing prefix.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11The distinction is practical: offsets represent a position in the result set; cursors represent where traversal should continue. Cursor pagination is therefore a good fit for “load more” feeds and sequential exports, but it does not inherently identify an arbitrary numbered page.
#1 Best Overall
Which one should you use?
| Need | Better starting point | Why | Trade-off |
|---|---|---|---|
| Jump to page 20 or show numbered page controls | Offset | Direct page-position semantics are simple. | Deep offsets can require processing skipped rows, and changes to earlier rows can shift page positions. |
| Load successive pages through a large feed or export | Cursor/keyset | Continues from the last ordered key rather than skipping an ever-growing prefix. | Requires stable ordering, cursor handling, and suitable indexes. |
| Traverse a collection while it is changing | Usually cursor/keyset | Less sensitive to insertions or deletions before the last-seen boundary. | Does not by itself provide a frozen, point-in-time snapshot. |
| Support both page jumps and efficient neighboring-page navigation | Hybrid | Use cursors for next/previous and offsets for explicit jumps. | Keep the ordering and behavior consistent between navigation modes; jumps still incur offset costs. |
Why changing data can disrupt pagination
With offset pagination, each request counts from the current result set. If a row is inserted or deleted before the next requested offset, later rows shift position; a client can see a repeated row or miss one. Microsoft Graph’s collection guidance also warns that changes during pagination can produce missing or repeated results.
Keyset pagination is less sensitive to changes below the last-seen key: it resumes beyond that boundary rather than counting from the start. But neither method alone guarantees that every page reflects one consistent snapshot. For an audit or export that must be complete as of a precise moment, specify the snapshot or consistency contract separately from the pagination mechanism.
Make ordering deterministic before adding pagination
Every paginated query needs a fully unique order. If records can share a sort value, add a unique tie-breaker such as an ID. Microsoft’s EF Core documentation states: “Regardless of the pagination method used, always make sure that your ordering is fully unique.” Without that, rows tied at the page boundary can move unpredictably between requests.
For keyset pagination, retain every ordered value from the last item and use all of them in the continuation condition. For example, for ascending order by created_at and then id, continue with:
Rank #3
created_at > :last_created_at
OR (created_at = :last_created_at AND id > :last_id)
For descending traversal, reverse the comparisons and ordering consistently. The cursor must represent the complete ordering boundary, not just the first sort value.
Indexes and query design affect cursor performance
Keyset pagination is not automatically fast simply because it uses a cursor. Indexes should align with the ordered columns and relevant filters so the database can locate the continuation boundary efficiently. Microsoft’s EF Core guidance emphasizes that proper indexing is vital and recommends indexes corresponding to the pagination ordering. Validate the actual query plan for your database, filters, data distribution, and workload before claiming a performance advantage.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Handle API continuation tokens according to the contract
An API cursor is usually an opaque continuation token, not a raw database cursor. Pass the server-provided token or URL back unchanged; do not construct or edit it. Keep filters and sort order consistent across requests, and follow that API’s page-size and continuation rules.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesFor example, Microsoft Graph says clients “MUST treat the nextLink URL as opaque.” Its guidance also recommends stable ordering, supplemented with additional sort keys such as a key. Microsoft’s Data API Builder guidance for GraphQL similarly treats the after cursor as opaque and immutable, using endCursor and hasNextPage to drive the next request. These are API-specific contracts, not interchangeable token formats.
Endpoint behavior varies across APIs, including cursor support, filtering and sorting options, and page-size limits. Consult the documentation for the specific endpoint you use rather than assuming one API’s limits apply elsewhere.
Quick Recap
Choose based on navigation and workload, then measure
- Choose offset pagination when direct numbered-page access is a requirement and the workload can tolerate the cost of deeper offsets.
- Choose cursor/keyset pagination for sequential traversal of large collections, with a unique order and matching indexes.
- Use a hybrid only when the product genuinely needs both efficient adjacent navigation and direct jumps.
- For exact point-in-time completeness, define consistency or snapshot behavior separately.
- Benchmark with the actual database, indexes, query plan, data distribution, and workload. There is no universal speed multiplier that applies to every system.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




