[SERVER-5331] Use heuristics to choose selective index bounds within $all Created: 19/Mar/12 Updated: 13/Jul/23 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 2.0.3 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Nic Cottrell (Personal) | Assignee: | Backlog - Query Optimization |
| Resolution: | Unresolved | Votes: | 8 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Query Optimization
|
||||||||
| Participants: | |||||||||
| Description |
|
I was just tracking some slow queries and found queries like: db.Example.find({ "indices.text": { $all: [ "le", "mois", "suivant" ] }, lc: "fra", group: "all" }) giving { } but > db.Example.find({ "indices.text": { $all: [ "suivant", "le", "mois" ] }, lc: "fra", group: "all" }).explain(); } I can manually re-order my inputs to the $all putting longest strings first, but perhaps Mongo should have similar logic built in since longer strings should naturally be less common and therefore need less scanning? |