问题
I'm a bit new to indexes, but I am curious about the usecases for an index. (I assume it makes queries on the indexed fields much faster.) Is there a criteria for determining what to index and when to index? What kind of performance benefits should I expect -- specifically using Mongoid with MongoDb on a Rails app?
回答1:
Check out Indexes MongoDB docs and Indexing Advice and FAQ, lots of great info here.
来源:https://stackoverflow.com/questions/6183945/when-to-index-what-to-index-in-mongoid