[SERVER-19849] Query don't use index Created: 10/Aug/15 Updated: 03/Oct/15 Resolved: 03/Oct/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Index Maintenance, Performance |
| Affects Version/s: | 3.0.5 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | SHUK LING | Assignee: | Ramon Fernandez Marina |
| Resolution: | Incomplete | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL |
| Steps To Reproduce: | Randomly with high load on slave or master. |
| Participants: |
| Description |
|
Randomly the query (slave or master) stop to use an index and start to scan the collection. Here is an extract of the db.currentOp:
Index:
|
| Comments |
| Comment by Ramon Fernandez Marina [ 03/Oct/15 ] | |||||||
|
support@sesam.hk, we haven't heard back from you for a while so I'm closing this ticket. If the issue persists please provide the information requested in my previous comment so we can investigate further. Regards, | |||||||
| Comment by Ramon Fernandez Marina [ 10/Sep/15 ] | |||||||
|
support@sesam.hk, unless I missed something the information you sent does not capture the problem described in the ticket. From the initial description my best guess is that this is an issue with index selection: the {code:1} index is being used and it's not selective enough to complete the query quickly. If your query is on {offerCode:1, dropCode:1, customerId:1} then one option is to build such an index. Another alternative is to hint() on the {customerId:1} index, which is bound to be more selective. Unfortunately the output of the explain(true) command doesn't provide the information I was looking for. Can you please run the following commands on your primary:
And also the following command on a secondary:
Thanks, | |||||||
| Comment by SHUK LING [ 17/Aug/15 ] | |||||||
|
Hi, Do you need more informations ? Best regards | |||||||
| Comment by Ramon Fernandez Marina [ 11/Aug/15 ] | |||||||
|
Thanks for opening a new ticket support@sesam.hk, we'll need more information to diagnose this problem. The output of db.currentOp indicates an index scan, not a collection scan, but it could be that a suboptimal index is being used for your query. First off, can you please confirm that the offending query is as follows:
Next I'd like you ask you to follow the steps below and upload the resulting information:
You can put each piece of information in a file, zip all files along with the part of the mongod.log log file created while running the above commands, and post it to this ticket. If the resulting file is too large (hundreds of megabytes) please let me know before and I'll send you different upload instructions. Thanks, |