|
One thing we would like to do in this area is treat $or and $in identically in the query engine, ensuring that we can create the same quality plans for these logically equivalent operators and that both execute efficiently. However, this ticket is quite general, so we are closing it as "Won't Fix". Many improvements and changes to the query engine have been made in the seven years or so since this was filed.
|
|
Does this include optimizing cases of an empty $in list and a list with a single item? In our testing, $in with an empty list (in a "count" query, no less) was extremely slow. Does it scan the index whether there's anything in the list or not? It seems like it ought to just see the empty list and assume no matches, since you can't match nothing, no matter how hard you search.
|