A follow-up to a keyset pagination post, addressing reader pushback about sortable grids. Covers keyset pagination with fixed and dynamic sort columns in EF Core, including C# cursor implementations with composite indexes. Honestly quantifies the indexing cost: each sortable column requires a composite index, and four indexes on a 10M-row table can consume ~1 GB of storage with meaningful write amplification. Includes a working Razor Pages + htmx infinite-scroll demo using cursor-based fragment loading. Concludes with a clear decision rule: use keyset only when the table is large AND write-heavy AND user-facing; otherwise offset is fine.

12m read timeFrom woodruff.dev
Post cover image
Table of contents
Where the original argument holds and where it didn’tKeyset with a fixed non-ID sortKeyset with dynamic sort columnsThe indexing realityA working demo: Razor Pages + htmxWhen to actually use offsetClosing
161 Impressions