TLDR Web Dev · ARTICLES & TUTORIALS

OFFSET CONSIDERED HARMFUL OR: THE SURPRISING COMPLEXITY OF PAGINATION IN SQL

cedardb.com11 min read

Summary from the TLDR Web Dev newsletter

SQL pagination is complex and using the offset keyword can make it worse. `offset` can lead to duplicate results and degrade performance, especially with large datasets, due to its need to process and skip data. A better alternative is to use predicate-based pagination with a `where` condition.