[SERVER-17182] Planner ignores index filter and uses slow query plan Created: 04/Feb/15 Updated: 16/Feb/18 Resolved: 06/Feb/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 2.6.7 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Ben Polidore | Assignee: | David Storch |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
windows server 2008 R2 |
||
| Issue Links: |
|
||||||||
| Operating System: | Windows | ||||||||
| Steps To Reproduce: | Use this schema under heavy load. |
||||||||
| Participants: | |||||||||
| Description |
| Comments |
| Comment by David Storch [ 06/Feb/15 ] | |
|
Hi polidore, Glad to hear that you resolved your issue. I am going to close this ticket as Works as Designed. I agree that there is room for improvement in MongoDB's plan selection and plan caching behavior. One related ticket which may be of interest is Best, | |
| Comment by Ben Polidore [ 06/Feb/15 ] | |
|
We resolved it!!! The issue is that our index filters didn't have the projection that we were using in our application. It might be nice to be able to wildcard the projection and the sort when creating index filters. One more wrinkle for anyone else that has this issue: the index filters were still being intermittently ignored until we disconnected and reconnected some very busy clients. In general, I think mongodb may need some improvement here. The plan cache gets reset VERY often in our db, and it picks the wrong plan very often as well. In an environment like ours (not many docs, very many in place updates), it might be better to have some kind of longer term statistic on the efficiency of various plans instead of doing 1 trial and keeping it for the next 1000 updates. Thanks, | |
| Comment by David Storch [ 05/Feb/15 ] | |
|
Hi polidore, It does appear from the log line above that the index filter is not getting applied. Could you please run the following command against each mongod in your cluster and reply with the resulting output?
As a first step I would like to verify that the plan cache filter is correctly configured. Also, please note that plan cache filters are not persistent, and must be re-configured after every restart. One follow-up question: is the slow query from the logs above being routed through a mongos? Best, |