SQL Fundamentals

LIMIT & OFFSET: Interview

Why does deep OFFSET pagination become slow and unstable? The database still locates and discards the skipped rows, so work grows with the page depth. Concurren

Why does deep OFFSET pagination become slow and unstable?

The database still locates and discards the skipped rows, so work grows with the page depth. Concurrent inserts can also move rows between pages unless ordering is deterministic.

Recommend keyset pagination for large, frequently changing result sets.