[SERVER-30063] Similar queries yet horrible performance for one of them Created: 08/Jul/17  Updated: 16/Jul/17  Resolved: 16/Jul/17

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: 3.2.13
Fix Version/s: None

Type: Question Priority: Critical - P2
Reporter: Elyes Gherib Assignee: Unassigned
Resolution: Incomplete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

MongoDB v3.2.13
3-nodes cluster in MongoDB Cloud, M10 instances


Attachments: PNG File 1.png     PNG File 2.png     File explain1.json     File explain2.json     File index.json    
Participants:

 Description   

I have two queries that are strictly identical, except for one field.

Query 1: "fieldX":

{ $in: [ "value1", "value2", "value3", "value4", "value5" ] }

Query 2: "fieldX": "value6"

Query 1 takes 2 seconds to execute.
Query 2 takes 5.87 seconds to execute.

Important information: my cluster has crashed a week ago during the creation of the index that is used by the queries. The MongoDB Cloud team restarted its 3 nodes.

Attached are screenshots of the two queries and their execution times as displayed by Robomongo.

Any ideas?



 Comments   
Comment by Elyes Gherib [ 08/Jul/17 ]

Please close this issue.

Comment by Elyes Gherib [ 08/Jul/17 ]

I also attached the JSON of the winning plans for both queries, along with the index composition.
Query 2 has 5 more input stages than query 1.

Generated at Thu Feb 08 04:22:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.