pagination-optimization
Installation
SKILL.md
Pagination Optimization
Three pagination strategies with fundamentally different performance characteristics and API contracts. The choice is irreversible once clients depend on it — pick correctly upfront.
Phase 1: Discovery
Establish before recommending anything:
What does the sort order depend on?
- Stable unique column (created_at + id, auto-increment id) → keyset is viable
- Arbitrary user-defined sort (price, name, relevance score) → keyset is harder; offset may be necessary with mitigation
- Relevance/ranking from full-text search → offset only; keyset doesn't compose with score-based ranking