4 ms·
Is MongoDB actually able to combine 2 or more indices?
by MartinMond 14y ago
Is MongoDB actually able to combine 2 or more indices?
- jiryu 14y agoNo - it can only use one for a given query. But a compound index like the ones I describe in the post can index many fields.
- MartinMond 14y agoYes of course, but it's kinda slow if you have to maintain one compound index for each possible query you're going to run, that's why I was asking.
- chmod775 14y agoNope, you can use the compound index 'a,b,c' to query over the following fields: a a.b a,b,c The manual actually explains it like that.
- mattparlane 14y agoYou may be interested in this: https://jira.mongodb.org/browse/SERVER-3071 https://jira.mongodb.org/browse/SERVER-3071 It's index intersection, and it's scheduled for 2.3.1 which is the next next dev release. I'm hoping it makes it in for 2.4.