Re:Optimizing MongoDB Compound Indexes
by dkhenry on Monday October 08, 2012 @04:30PM
(#4628622)
What should be added to this is the ability to tell Mongo to return an error if your query requires a table scan. That one configuration item can be the difference between a request returning an error and a whole site going down for an extended period.
[ Parent
| on HN ]
There is a config setting for that
notablescan = true
http://docs.mongodb.org/manual/reference/configuration-optio...Right I was saying that the author should add that to his article. Its a very valuable configuration item and anytime your dealing with optimizing indexes its worth enabling.
Re:Optimizing MongoDB Compound Indexes
by lucian1900 on Monday October 08, 2012 @04:45PM
(#4628670)
You can ask it to explain what it did, just like you'd ask for the last error. Then in your app enforce whatever rules related to indexes you wish.
Re:Optimizing MongoDB Compound Indexes
by mattparlane on Monday October 08, 2012 @04:52PM
(#4628691)
explain actually runs the query. From http://www.mongodb.org/display/DOCS/Explain :
Note that explain runs the actual query to determine the result. If the query is slow, the explain will be slow too.