E
E
Emix2021-04-07 11:07:35
MongoDB
Emix, 2021-04-07 11:07:35

MongoDB slow skip how can I speed it up?

With large skip values ​​(more than 50K documents), it works extremely slowly, even with indexes

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuriy Vorobyov, 2021-04-07
@YuriyVorobyov1333

None
Text from documentation :


The skip() method requires the server to scan from the beginning of the input results set before beginning to return results. As the offset increases, skip() will become slower.
Range queries can use indexes to avoid scanning unwanted documents, typically yielding better performance as the offset grows compared to using skip() for pagination.

You can look here , maybe it will help you somehow

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question