slides/mongodb/idx-recap3.xml
When can indexes not be used?
32/43
Indexes (2)
Replication
  • • Many types of negations ($ne, $not, $nin).
  • • Tricky arithmetic ($mod).
  • • Most regular expressions (/ondo/), unless anchored to the start of the string (/^Lon/).
  • • JavaScript expressions in $where clauses, such as where elevation > population. In that case, try to pre-compute.