KEYSET CURSORS, NOT OFFSETS, FOR POSTGRES PAGINATION
Offset pagination in Postgres can decrease performance and correctness as the offset increases. Keyset pagination, using a compound cursor based on multiple columns, has much better performance and handles deletions gracefully, maintaining a stable order even with data modifications. However, keyset pagination still has subtle correctness issues related to concurrent inserts causing rows to be skipped, but there are strategies to get around this.