distinct is a database command, not a regular query - so hint and
explain don't work.
> Question: am I correct in assuming that distinct() does not use
> indices? If yes, why? If not, why the query took so long to return?
I think distinct will use an index (somebody please correct me if I'm
wrong), but even so it still needs to scan the index to get all of the
distinct values - in your case there are only two values, but there is
no way for the command to know that a priori.
I don't think that quite works (someone please correct me if I'm
wrong) - there's still no way of knowing if the values in the root
node are the only values that appear in the rest of tree.
> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>
>