The problem is that this query takes about 40s to complete on an M30 Atlas cluster (sometimes 10s or 20s if entirely fetched from memory, I presume).
Is this within the expected execution time for matching a term on 11M documents?
I would appreciate any suggestions on how i can optimize this kind of query.
Thanks for the tip, unfortunately it didn’t make a difference, probably because I’m only performing a count on the records.
My real use case will actually include more complex operations, like partial text searches. However, as I performed this simple test, i found the performance to be worse than I was expecting, so I was looking to know if there’s something I’m missing.
I have try to change my cluster tier from m30 to m50 but no change for search delay.
Guys from developper support said i need to change my cluster tier because m30 was overload but with m50 i got same result and it was not overload when my query was running.
Is it possible to reduce response time by using $search pipeline?
or I am using wildcard in $search, is it possible to use similar to wildcard in $project?
This work has been started and it is coming in the next month or two. It will be lightning fast and it will also be usable in MongoDB Charts. If you’d like to be updated when this feature is released you can vote for it here