Special Offer! Limited-Time Offer! Get 25% Off on All Certification Exams – Prepare & Pass with Confidence! Use Code: DC25OFF
db.orders.find(
{ status: "shipped", deliveryDate: { $lte: new Date("2023-12-31") } }
).sort({ deliveryDate: -1 })
The explain method reveals the following key details indicating the query is not efficiently utilizing indexes:
{
"queryPlanner": {
...
"winningPlan": {
"stage": "SORT",
"sortPattern": { "deliveryDate": -1 },
...
"inputStage": {
"stage": "FETCH",
"inputStage": {
"stage": "IXSCAN",
"keyPattern": { "status": 1 },
...
}
}
}
},
"executionStats": {
"executionSuccess": true,
"nReturned": 100,
"executionTimeMillis": 120,
"totalKeysExamined": 500,
"totalDocsExamined": 500,
...
},
...
}
What action should the data modeler take to enhance the performance of this query?
© Copyrights Dumpscity 2025. All Rights Reserved
We use cookies to ensure your best experience. So we hope you are happy to receive all cookies on the Dumpscity.