Title: [Order 06][P2] Replace offset checkpoint paging with keyset paging · Issue #63 · NEventStore/NEventStore.Persistence.SQL · GitHub
Open Graph Title: [Order 06][P2] Replace offset checkpoint paging with keyset paging · Issue #63 · NEventStore/NEventStore.Persistence.SQL
X Title: [Order 06][P2] Replace offset checkpoint paging with keyset paging · Issue #63 · NEventStore/NEventStore.Persistence.SQL
Description: Priority order Order: 06 of 09 Priority: P2 performance Problem Checkpoint reads use offset/ROW_NUMBER paging instead of advancing by the last seen checkpoint. Evidence: src/NEventStore.Persistence.Sql/SqlPersistenceEngine.cs:347 Checkpo...
Open Graph Description: Priority order Order: 06 of 09 Priority: P2 performance Problem Checkpoint reads use offset/ROW_NUMBER paging instead of advancing by the last seen checkpoint. Evidence: src/NEventStore.Persistence...
X Description: Priority order Order: 06 of 09 Priority: P2 performance Problem Checkpoint reads use offset/ROW_NUMBER paging instead of advancing by the last seen checkpoint. Evidence: src/NEventStore.Persistence...
Opengraph URL: https://github.com/NEventStore/NEventStore.Persistence.SQL/issues/63
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Order 06][P2] Replace offset checkpoint paging with keyset paging","articleBody":"## Priority order\n\nOrder: 06 of 09\nPriority: P2 performance\n\n## Problem\n\nCheckpoint reads use offset/ROW_NUMBER paging instead of advancing by the last seen checkpoint.\n\nEvidence:\n\n- `src/NEventStore.Persistence.Sql/SqlPersistenceEngine.cs:347`\n- Checkpoint reads pass a fixed checkpoint token.\n- Common SQL uses `LIMIT @Limit OFFSET @Skip`.\n- SQL Server transforms checkpoint reads to `ROW_NUMBER()` paging in `MsSqlDialect.CommonTableExpressionPaging`.\n\n## Impact\n\n- Long catch-up reads become increasingly expensive as `@Skip` grows.\n- SQL Server recomputes row numbers for every page.\n- This is a hot path for polling clients and projections.\n\n## Mandatory test-first workflow\n\n- Add tests first that verify ordered, complete multi-page checkpoint reads.\n- Tests must cover result counts greater than the configured page size.\n- Tests must cover from/to checkpoint ranges.\n- Do not change production paging logic until these tests are in place.\n\n## Proposed action\n\n- Page checkpoint reads by last seen `CheckpointNumber` instead of offset.\n- Update sync and async paging delegates for checkpoint queries to set `@CheckpointNumber` to the last row.\n- Keep `@ToCheckpointNumber` as the upper bound for range reads.\n\n## Acceptance criteria\n\n- Multi-page checkpoint reads remain ordered and gap-free.\n- Bucket-scoped and global checkpoint reads are both covered.\n- A benchmark or integration timing plan is documented for large catch-up reads.\n\nSource: `docs/Project-Analysis-Issue-Drafts.md`.","author":{"url":"https://github.com/AGiorgetti","@type":"Person","name":"AGiorgetti"},"datePublished":"2026-06-11T09:21:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/63/NEventStore.Persistence.SQL/issues/63"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:27cb2cf0-a31b-10eb-a6c5-ca9358ecdc7a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E68E:A0657:6CAFAC:9280EE:6A4DA946 |
| html-safe-nonce | 10bc72f20946ff929c8e779cb36bd3f786ae21574549388400afc9d30a9f484e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjhFOkEwNjU3OjZDQUZBQzo5MjgwRUU6NkE0REE5NDYiLCJ2aXNpdG9yX2lkIjoiMjkwMTEzMDQ2Nzg0NjE2Nzc0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 63f6244e6bd8c97f5d0ce5d4ab07d14735b37af68795ab6b296b5b4d9fe8869c |
| hovercard-subject-tag | issue:4639066960 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NEventStore/NEventStore.Persistence.SQL/63/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7788e9404694ab995f7dc37ec8f9df54a4a9d995ac1e7853438bcb71548c32fd/NEventStore/NEventStore.Persistence.SQL/issues/63 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7788e9404694ab995f7dc37ec8f9df54a4a9d995ac1e7853438bcb71548c32fd/NEventStore/NEventStore.Persistence.SQL/issues/63 |
| og:image:alt | Priority order Order: 06 of 09 Priority: P2 performance Problem Checkpoint reads use offset/ROW_NUMBER paging instead of advancing by the last seen checkpoint. Evidence: src/NEventStore.Persistence... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | AGiorgetti |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| go-import | github.com/NEventStore/NEventStore.Persistence.SQL git https://github.com/NEventStore/NEventStore.Persistence.SQL.git |
| octolytics-dimension-user_id | 4486767 |
| octolytics-dimension-user_login | NEventStore |
| octolytics-dimension-repository_id | 36130556 |
| octolytics-dimension-repository_nwo | NEventStore/NEventStore.Persistence.SQL |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36130556 |
| octolytics-dimension-repository_network_root_nwo | NEventStore/NEventStore.Persistence.SQL |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 47723578ce6819210724ef064c858fce6d3115a3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width