I have trouble understanding what MongoDB is doing with my queries. My documents contain almost exclusively array fields, keeping me from using compound indexes. every field is Indexed with ensureIndex({FieldName:1})
The queries are AND concatenated like that:
{$and: [{FIELD1:"field1Val"},{FIELD2:"field2Val"},{FIELD3:"field3Val"}]}
If i run this query, MongoDB appears to be using only one index. Why isn't MongoDB using all the Indexes in parallel and then intersects them?
The same problem solved with Lucene runs 8 times faster then my MongoDB implementaition does now.
$and
there. Just make it{FIELD1: 'field1Val', FIELD2: 'field2Val', FIELD3: 'field3Val'}
and the optimizer may be able to do more. – JohnnyHK$and
because it's not helping. Also, it's very suspect to have mostly arrays in your documents. If you're having trouble with performance, could you post an example document, query, and an explain for the query? – wdberkeley