Slow Postgres pagination? I tested one query on 500k rows:
Original: 33.1 ms
Composite index: 3.21 ms
Cursor pagination (no OFFSET): 0.073 ms
About 450x faster in my test. Short demo below 👇
#PostgreSQL#SQL#Database
Why it works:
OFFSET 10000 reads 10,000 rows and throws them away. A cursor starts right after the last row you showed.
Trade-offs: you can't jump to page N, and an index slows writes a little.
Test: Neon Postgres, EXPLAIN ANALYZE.
My client kept asking me to "just add one more project" or "fix a testimonial."
So I built them an admin dashboard:
✅ Add, edit & publish case studies (live preview)
✅ Manage testimonials
✅ Track visitors & CV downloads
No more waiting on a developer. #buildinpublic