TLDR: MongoDB Pagination - Skip is Slow
Date: 2017-03-23 Source: https://arpitbhayani.me/blogs/mongodb-cursor-skip-is-slow
Overview
Understand when & why skip impacts pagination performance. Learn efficient alternatives for large datasets. MongoDB’s cursor object has a method called skip, which as per documentation and definition, controls where MongoDB begins returning results.
Key Points
- MongoDB’s cursor object has a method called skip, which as per documentation and definition, controls where MongoDB begins returning results.
- Thus in combination with function limit, one can easily have paginated results.
- I have written a blog post on how you can have Fast and Efficient Pagination in MongoDB.
- But while going through the documentation of skip, there is something interesting to notice.
- There is a small warning in MongoDB documentation, that states
-