Skip to content

Instantly share code, notes, and snippets.

@LarryLuTW
Last active May 9, 2022 10:06
Show Gist options
  • Save LarryLuTW/fc6cf26f637d3cab21716d3edcce96ab to your computer and use it in GitHub Desktop.
Save LarryLuTW/fc6cf26f637d3cab21716d3edcce96ab to your computer and use it in GitHub Desktop.
{
"explainVersion": "1",
"queryPlanner": {
"namespace": "store.inventory",
"indexFilterSet": false,
"parsedQuery": {
"$and": [
{
"quantity": {
"$eq": 1
}
},
{
"price": {
"$lt": 10000
}
}
]
},
"maxIndexedOrSolutionsReached": false,
"maxIndexedAndSolutionsReached": false,
"maxScansToExplodeReached": false,
"winningPlan": {
"stage": "FETCH",
"filter": {
"price": {
"$lt": 10000
}
},
"inputStage": {
"stage": "IXSCAN",
"keyPattern": {
"quantity": 1
},
"indexName": "quantity_1",
"isMultiKey": false,
"multiKeyPaths": {
"quantity": []
},
"isUnique": false,
"isSparse": false,
"isPartial": false,
"indexVersion": 2,
"direction": "forward",
"indexBounds": {
"quantity": [
"[1, 1]"
]
}
}
},
"rejectedPlans": [
{
"stage": "FETCH",
"filter": {
"quantity": {
"$eq": 1
}
},
"inputStage": {
"stage": "IXSCAN",
"keyPattern": {
"price": 1
},
"indexName": "price_1",
"isMultiKey": false,
"multiKeyPaths": {
"price": []
},
"isUnique": false,
"isSparse": false,
"isPartial": false,
"indexVersion": 2,
"direction": "forward",
"indexBounds": {
"price": [
"[-inf.0, 10000)"
]
}
}
}
]
},
"executionStats": {
"executionSuccess": true,
"nReturned": 148,
"executionTimeMillis": 0,
"totalKeysExamined": 148,
"totalDocsExamined": 148,
"executionStages": {
"stage": "FETCH",
"filter": {
"price": {
"$lt": 10000
}
},
"nReturned": 148,
"executionTimeMillisEstimate": 0,
"works": 149,
"advanced": 148,
"needTime": 0,
"needYield": 0,
"saveState": 0,
"restoreState": 0,
"isEOF": 1,
"docsExamined": 148,
"alreadyHasObj": 0,
"inputStage": {
"stage": "IXSCAN",
"nReturned": 148,
"executionTimeMillisEstimate": 0,
"works": 149,
"advanced": 148,
"needTime": 0,
"needYield": 0,
"saveState": 0,
"restoreState": 0,
"isEOF": 1,
"keyPattern": {
"quantity": 1
},
"indexName": "quantity_1",
"isMultiKey": false,
"multiKeyPaths": {
"quantity": []
},
"isUnique": false,
"isSparse": false,
"isPartial": false,
"indexVersion": 2,
"direction": "forward",
"indexBounds": {
"quantity": [
"[1, 1]"
]
},
"keysExamined": 148,
"seeks": 1,
"dupsTested": 0,
"dupsDropped": 0
}
},
"allPlansExecution": [
{
"nReturned": 101,
"executionTimeMillisEstimate": 0,
"totalKeysExamined": 101,
"totalDocsExamined": 101,
"executionStages": {
"stage": "FETCH",
"filter": {
"price": {
"$lt": 10000
}
},
"nReturned": 101,
"executionTimeMillisEstimate": 0,
"works": 101,
"advanced": 101,
"needTime": 0,
"needYield": 0,
"saveState": 0,
"restoreState": 0,
"isEOF": 0,
"docsExamined": 101,
"alreadyHasObj": 0,
"inputStage": {
"stage": "IXSCAN",
"nReturned": 101,
"executionTimeMillisEstimate": 0,
"works": 101,
"advanced": 101,
"needTime": 0,
"needYield": 0,
"saveState": 0,
"restoreState": 0,
"isEOF": 0,
"keyPattern": {
"quantity": 1
},
"indexName": "quantity_1",
"isMultiKey": false,
"multiKeyPaths": {
"quantity": []
},
"isUnique": false,
"isSparse": false,
"isPartial": false,
"indexVersion": 2,
"direction": "forward",
"indexBounds": {
"quantity": [
"[1, 1]"
]
},
"keysExamined": 101,
"seeks": 1,
"dupsTested": 0,
"dupsDropped": 0
}
}
},
{
"nReturned": 15,
"executionTimeMillisEstimate": 0,
"totalKeysExamined": 101,
"totalDocsExamined": 101,
"executionStages": {
"stage": "FETCH",
"filter": {
"quantity": {
"$eq": 1
}
},
"nReturned": 15,
"executionTimeMillisEstimate": 0,
"works": 101,
"advanced": 15,
"needTime": 86,
"needYield": 0,
"saveState": 0,
"restoreState": 0,
"isEOF": 0,
"docsExamined": 101,
"alreadyHasObj": 0,
"inputStage": {
"stage": "IXSCAN",
"nReturned": 101,
"executionTimeMillisEstimate": 0,
"works": 101,
"advanced": 101,
"needTime": 0,
"needYield": 0,
"saveState": 0,
"restoreState": 0,
"isEOF": 0,
"keyPattern": {
"price": 1
},
"indexName": "price_1",
"isMultiKey": false,
"multiKeyPaths": {
"price": []
},
"isUnique": false,
"isSparse": false,
"isPartial": false,
"indexVersion": 2,
"direction": "forward",
"indexBounds": {
"price": [
"[-inf.0, 10000)"
]
},
"keysExamined": 101,
"seeks": 1,
"dupsTested": 0,
"dupsDropped": 0
}
}
}
]
},
"command": {
"find": "inventory",
"filter": {
"quantity": 1,
"price": {
"$lt": 10000
}
},
"$db": "store"
},
"serverInfo": {
"host": "f41cc2d40860",
"port": 27017,
"version": "5.0.8",
"gitVersion": "c87e1c23421bf79614baf500fda6622bd90f674e"
},
"serverParameters": {
"internalQueryFacetBufferSizeBytes": 104857600,
"internalQueryFacetMaxOutputDocSizeBytes": 104857600,
"internalLookupStageIntermediateDocumentMaxSizeBytes": 104857600,
"internalDocumentSourceGroupMaxMemoryBytes": 104857600,
"internalQueryMaxBlockingSortMemoryUsageBytes": 104857600,
"internalQueryProhibitBlockingMergeOnMongoS": 0,
"internalQueryMaxAddToSetBytes": 104857600,
"internalDocumentSourceSetWindowFieldsMaxMemoryBytes": 104857600
},
"ok": 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment