Pagination in MySQL
Apr 18, 2023Aaron Francis

Summary
This post introduces and explains two primary methods for paginating results in MySQL: offset/limit and cursor-based pagination. It emphasizes the necessity of deterministic ordering for effective pagination, elaborates on the strengths and weaknesses of offset/limit (including 'drifting pages' and performance degradation with deep offsets), and presents the deferred join technique as an optimization for offset/limit. It also introduces cursor-based pagination as an alternative approach.