A
A
Alexey2019-03-28 11:30:49
MongoDB
Alexey, 2019-03-28 11:30:49

How to speed up MongoDb data fetching?

The situation is as follows, there is a collection with 4.5 million documents. According to these documents, it is necessary to make a selection, mostly constant queries - select the last 100 documents, sort by a specific field and return 50 documents, etc.
The indexing of the fields on which the selection passes is carried out, but the operation time is 9-14 seconds.
Question:
How to implement query caching? How to properly optimize the database to minimize the time it takes to return the necessary data?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Shatokhin, 2019-03-28
@Sovigod

Look at explain requests. It looks like the indexes are not optimally created.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question