Pagination in MySQL – offset vs. cursor



Pagination in MySQL – offset vs. cursor

Pagination in MySQL - offset vs. cursor

📚 Learn more about PlanetScale
• Website: https://planetscale.com/
• Docs: https://planetscale.com/docs
——————————————————
Blog post on pagination: https://planetscale.com/blog/mysql-pagination.
Video on deferred joins: https://planetscale.com/learn/courses/mysql-for-developers/examples/deferred-joins.
Article on deferred joins: https://aaronfrancis.com/2022/efficient-pagination-using-deferred-joins.
——————————————————
00:00 Intro
00:12 How to pronounce paginate
00:30 The two pagination methods
00:54 We have bosses
01:25 Select * from people
01:45 Deterministic ordering
03:20 Limit/offset pagination
05:17 Shifting records in offset pagination
06:12 Cursor based pagination
08:13 Ordering by two columns
09:23 Cursor pagination drawbacks
09:53 Cursor pagination advantages
10:50 Summary of differences
——————————————————

💬 Follow PlanetScale on social media
• Twitter: https://twitter.com/planetscaledata
• TikTok: https://www.tiktok.com/@planetscale
• Twitch: https://www.twitch.tv/planetscale
• LinkedIn: https://www.linkedin.com/company/planetscale/