Hi @Prasad_Kini,
- Is there a limit to the number of Atlas Search indexes (to be used with the $search operator) that can be created?
Currently, as per the Create an Atlas Search Index documentation, you cannot create more than:
- 3 indexes on
M0clusters. - 5 indexes on
M2clusters. - 10 indexes on
M5clusters.
There are no limits to the number of indexes you can create on M10+ clusters.
- db.profile.find seem to return different information when running the same queries on a local mongo instance vs Atlas. Is this expected?
These are two separate instances, if the data is not the same, more than likely the data being returned is not the same. Do you have more information regarding this?
- Profiler on Atlas shows a field “durationMillis” which seems to carry the time taken by the query. The results from db.profile.find (in Studio 3T) does not have this field. It does have the field “millis” which comes back as 0.0 for all Atlas queries. Any thoughts on this?
durationMillis is the total time the query took to complete. I’m not too familiar with Studio3T, it is not an officially supported MongoDB product. Do you have more information regarding these fields or have a sample document from each that you could provide?
- The find queries on Atlas with normal (not Atlas) indexes seem to be run a COLSCAN (on Atlas). The same queries on a local Mongo instance with identical run an IXSCAN as expected.
Could you provide sample document(s) from each environment as well as:
- The output of
db.collection.getIndexes()for both environments - The output of
db.collection.explain("executionStats").find(...)for both environments
- Query on Atlas executes in ~300ms (as per “durationMillis”). The same query returns in less than 50ms on the local Mongo instance. Seems like the COLSCAN is causing Atlas to be a lot slower than expected. Any thoughts on how to make Atlas use the available indexes?
This could depend on various factors in addition to the fact that one is a COLLSCAN whilst the other uses indexes. However, there is more information needed as requested above. In addition to all the above questions and information, can you provide:
- The MongoDB version in use for both environments
- The
collStatsfor both environments for the collections you are comparing
I understand you have mentioned $search, indexes and local instance of MongoDB however please note that Atlas Search’s $search stage is only available for Atlas instances. Details on my following post response may be useful here.
Regards,
Jason