Skip to content

Instantly share code, notes, and snippets.

@itorres-1
Last active June 4, 2022 19:54
Show Gist options
  • Save itorres-1/cc17cc1bc4647724ba108be1e1f5b558 to your computer and use it in GitHub Desktop.
Save itorres-1/cc17cc1bc4647724ba108be1e1f5b558 to your computer and use it in GitHub Desktop.
executionStats for obtaining the first batch of paginated results by passing ObjectId('f'.repeat(24)).
{
"explainVersion": "1",
"queryPlanner": {
"namespace": "myDB.myCollection",
"indexFilterSet": false,
"parsedQuery": {
"$and": [
{
"_id": {
"$lt": "ffffffffffffffffffffffff"
}
},
{
"location.geoJson": {
"$geoWithin": {
"$centerSphere": [
[
-106.485,
31.7619
],
0.006308033911990311
]
}
}
}
]
},
"maxIndexedOrSolutionsReached": false,
"maxIndexedAndSolutionsReached": false,
"maxScansToExplodeReached": false,
"winningPlan": {
"stage": "SORT",
"sortPattern": {
"_id": -1
},
"memLimit": 104857600,
"limitAmount": 10,
"type": "simple",
"inputStage": {
"stage": "FETCH",
"filter": {
"location.geoJson": {
"$geoWithin": {
"$centerSphere": [
[
-106.485,
31.7619
],
0.006308033911990311
]
}
}
},
"inputStage": {
"stage": "IXSCAN",
"keyPattern": {
"location.geoJson": "2dsphere",
"_id": -1
},
"indexName": "location.geoJson_2dsphere__id_-1",
"isMultiKey": false,
"multiKeyPaths": {
"location.geoJson": [],
"_id": []
},
"isUnique": false,
"isSparse": false,
"isPartial": false,
"indexVersion": 2,
"direction": "forward",
"indexBounds": {
"location.geoJson": [
"[-8736983277098762240, -8736983277098762240]",
"[-8732479677471391744, -8732479677471391744]",
"[-8729101977750863872, -8729101977750863872]",
"[-8728820502774153216, -8728820502774153216]",
"[-8728679765285797887, -8728670969192775681]",
"[-8728670969192775679, -8728662173099753473]",
"[-8728662173099753472, -8728662173099753472]",
"[-8728662173099753471, -8728653377006731265]",
"[-8728609396541620224, -8728609396541620224]",
"[-8728574212169531391, -8728539027797442561]",
"[-8728539027797442559, -8728530231704420353]",
"[-8728530231704420351, -8728521435611398145]",
"[-8728521435611398144, -8728521435611398144]",
"[-8728468659053264896, -8728468659053264896]",
"[-8728257552820731904, -8728257552820731904]",
"[-8727791359890554879, -8727782563797532673]",
"[-8727782563797532672, -8727782563797532672]",
"[-8727782563797532671, -8727773767704510465]",
"[-8727764971611488256, -8727764971611488256]",
"[-8727694602867310592, -8727694602867310592]",
"[-8726850177937178624, -8726850177937178624]",
"[-8726005753007046656, -8726005753007046656]",
"[-8725988160821002240, -8725988160821002240]",
"[-8725988160821002239, -8725979364727980033]",
"[-8725952976448913408, -8725952976448913408]",
"[-8725948578402402304, -8725948578402402304]",
"[-8725948578402402303, -8725946379379146753]",
"[-8725946379379146751, -8725944180355891201]",
"[-8725944180355891199, -8725935384262868993]",
"[-8725935384262868992, -8725935384262868992]",
"[-8725935384262868991, -8725900199890780161]",
"[-8725900199890780159, -8725865015518691329]",
"[-8723472478216650752, -8723472478216650752]",
"[-8718968878589280256, -8718968878589280256]"
],
"_id": [
"(ObjectId('ffffffffffffffffffffffff'), ObjectId('000000000000000000000000')]"
]
}
}
}
},
"rejectedPlans": [
{
"stage": "LIMIT",
"limitAmount": 10,
"inputStage": {
"stage": "FETCH",
"filter": {
"location.geoJson": {
"$geoWithin": {
"$centerSphere": [
[
-106.485,
31.7619
],
0.006308033911990311
]
}
}
},
"inputStage": {
"stage": "IXSCAN",
"keyPattern": {
"_id": 1
},
"indexName": "_id_",
"isMultiKey": false,
"multiKeyPaths": {
"_id": []
},
"isUnique": true,
"isSparse": false,
"isPartial": false,
"indexVersion": 2,
"direction": "backward",
"indexBounds": {
"_id": [
"(ObjectId('ffffffffffffffffffffffff'), ObjectId('000000000000000000000000')]"
]
}
}
}
},
{
"stage": "SORT",
"sortPattern": {
"_id": -1
},
"memLimit": 104857600,
"limitAmount": 10,
"type": "simple",
"inputStage": {
"stage": "FETCH",
"filter": {
"$and": [
{
"location.geoJson": {
"$geoWithin": {
"$centerSphere": [
[
-106.485,
31.7619
],
0.006308033911990311
]
}
}
},
{
"_id": {
"$lt": "ffffffffffffffffffffffff"
}
}
]
},
"inputStage": {
"stage": "IXSCAN",
"keyPattern": {
"location.geoJson": "2dsphere"
},
"indexName": "location.geoJson_2dsphere",
"isMultiKey": false,
"multiKeyPaths": {
"location.geoJson": []
},
"isUnique": false,
"isSparse": false,
"isPartial": false,
"indexVersion": 2,
"direction": "forward",
"indexBounds": {
"location.geoJson": [
"[-8736983277098762240, -8736983277098762240]",
"[-8732479677471391744, -8732479677471391744]",
"[-8729101977750863872, -8729101977750863872]",
"[-8728820502774153216, -8728820502774153216]",
"[-8728679765285797887, -8728670969192775681]",
"[-8728670969192775679, -8728662173099753473]",
"[-8728662173099753472, -8728662173099753472]",
"[-8728662173099753471, -8728653377006731265]",
"[-8728609396541620224, -8728609396541620224]",
"[-8728574212169531391, -8728539027797442561]",
"[-8728539027797442559, -8728530231704420353]",
"[-8728530231704420351, -8728521435611398145]",
"[-8728521435611398144, -8728521435611398144]",
"[-8728468659053264896, -8728468659053264896]",
"[-8728257552820731904, -8728257552820731904]",
"[-8727791359890554879, -8727782563797532673]",
"[-8727782563797532672, -8727782563797532672]",
"[-8727782563797532671, -8727773767704510465]",
"[-8727764971611488256, -8727764971611488256]",
"[-8727694602867310592, -8727694602867310592]",
"[-8726850177937178624, -8726850177937178624]",
"[-8726005753007046656, -8726005753007046656]",
"[-8725988160821002240, -8725988160821002240]",
"[-8725988160821002239, -8725979364727980033]",
"[-8725952976448913408, -8725952976448913408]",
"[-8725948578402402304, -8725948578402402304]",
"[-8725948578402402303, -8725946379379146753]",
"[-8725946379379146751, -8725944180355891201]",
"[-8725944180355891199, -8725935384262868993]",
"[-8725935384262868992, -8725935384262868992]",
"[-8725935384262868991, -8725900199890780161]",
"[-8725900199890780159, -8725865015518691329]",
"[-8723472478216650752, -8723472478216650752]",
"[-8718968878589280256, -8718968878589280256]"
]
}
}
}
},
{
"stage": "SORT",
"sortPattern": {
"_id": -1
},
"memLimit": 104857600,
"limitAmount": 10,
"type": "simple",
"inputStage": {
"stage": "FETCH",
"filter": {
"$and": [
{
"location.geoJson": {
"$geoWithin": {
"$centerSphere": [
[
-106.485,
31.7619
],
0.006308033911990311
]
}
}
},
{
"_id": {
"$lt": "ffffffffffffffffffffffff"
}
}
]
},
"inputStage": {
"stage": "IXSCAN",
"keyPattern": {
"location.geoJson": "2dsphere",
"colonies": 1
},
"indexName": "subscribedNonGlobals",
"isMultiKey": true,
"multiKeyPaths": {
"location.geoJson": [],
"colonies": [
"colonies"
]
},
"isUnique": false,
"isSparse": false,
"isPartial": false,
"indexVersion": 2,
"direction": "forward",
"indexBounds": {
"location.geoJson": [
"[-8736983277098762240, -8736983277098762240]",
"[-8732479677471391744, -8732479677471391744]",
"[-8729101977750863872, -8729101977750863872]",
"[-8728820502774153216, -8728820502774153216]",
"[-8728679765285797887, -8728670969192775681]",
"[-8728670969192775679, -8728662173099753473]",
"[-8728662173099753472, -8728662173099753472]",
"[-8728662173099753471, -8728653377006731265]",
"[-8728609396541620224, -8728609396541620224]",
"[-8728574212169531391, -8728539027797442561]",
"[-8728539027797442559, -8728530231704420353]",
"[-8728530231704420351, -8728521435611398145]",
"[-8728521435611398144, -8728521435611398144]",
"[-8728468659053264896, -8728468659053264896]",
"[-8728257552820731904, -8728257552820731904]",
"[-8727791359890554879, -8727782563797532673]",
"[-8727782563797532672, -8727782563797532672]",
"[-8727782563797532671, -8727773767704510465]",
"[-8727764971611488256, -8727764971611488256]",
"[-8727694602867310592, -8727694602867310592]",
"[-8726850177937178624, -8726850177937178624]",
"[-8726005753007046656, -8726005753007046656]",
"[-8725988160821002240, -8725988160821002240]",
"[-8725988160821002239, -8725979364727980033]",
"[-8725952976448913408, -8725952976448913408]",
"[-8725948578402402304, -8725948578402402304]",
"[-8725948578402402303, -8725946379379146753]",
"[-8725946379379146751, -8725944180355891201]",
"[-8725944180355891199, -8725935384262868993]",
"[-8725935384262868992, -8725935384262868992]",
"[-8725935384262868991, -8725900199890780161]",
"[-8725900199890780159, -8725865015518691329]",
"[-8723472478216650752, -8723472478216650752]",
"[-8718968878589280256, -8718968878589280256]"
],
"colonies": [
"[MinKey, MaxKey]"
]
}
}
}
}
]
},
"executionStats": {
"executionSuccess": true,
"nReturned": 10,
"executionTimeMillis": 6,
"totalKeysExamined": 110,
"totalDocsExamined": 110,
"executionStages": {
"stage": "SORT",
"nReturned": 10,
"executionTimeMillisEstimate": 0,
"works": 122,
"advanced": 10,
"needTime": 111,
"needYield": 0,
"saveState": 0,
"restoreState": 0,
"isEOF": 1,
"sortPattern": {
"_id": -1
},
"memLimit": 104857600,
"limitAmount": 10,
"type": "simple",
"totalDataSizeSorted": 4250,
"usedDisk": false,
"inputStage": {
"stage": "FETCH",
"filter": {
"location.geoJson": {
"$geoWithin": {
"$centerSphere": [
[
-106.485,
31.7619
],
0.006308033911990311
]
}
}
},
"nReturned": 110,
"executionTimeMillisEstimate": 0,
"works": 111,
"advanced": 110,
"needTime": 0,
"needYield": 0,
"saveState": 0,
"restoreState": 0,
"isEOF": 1,
"docsExamined": 110,
"alreadyHasObj": 0,
"inputStage": {
"stage": "IXSCAN",
"nReturned": 110,
"executionTimeMillisEstimate": 0,
"works": 111,
"advanced": 110,
"needTime": 0,
"needYield": 0,
"saveState": 0,
"restoreState": 0,
"isEOF": 1,
"keyPattern": {
"location.geoJson": "2dsphere",
"_id": -1
},
"indexName": "location.geoJson_2dsphere__id_-1",
"isMultiKey": false,
"multiKeyPaths": {
"location.geoJson": [],
"_id": []
},
"isUnique": false,
"isSparse": false,
"isPartial": false,
"indexVersion": 2,
"direction": "forward",
"indexBounds": {
"location.geoJson": [
"[-8736983277098762240, -8736983277098762240]",
"[-8732479677471391744, -8732479677471391744]",
"[-8729101977750863872, -8729101977750863872]",
"[-8728820502774153216, -8728820502774153216]",
"[-8728679765285797887, -8728670969192775681]",
"[-8728670969192775679, -8728662173099753473]",
"[-8728662173099753472, -8728662173099753472]",
"[-8728662173099753471, -8728653377006731265]",
"[-8728609396541620224, -8728609396541620224]",
"[-8728574212169531391, -8728539027797442561]",
"[-8728539027797442559, -8728530231704420353]",
"[-8728530231704420351, -8728521435611398145]",
"[-8728521435611398144, -8728521435611398144]",
"[-8728468659053264896, -8728468659053264896]",
"[-8728257552820731904, -8728257552820731904]",
"[-8727791359890554879, -8727782563797532673]",
"[-8727782563797532672, -8727782563797532672]",
"[-8727782563797532671, -8727773767704510465]",
"[-8727764971611488256, -8727764971611488256]",
"[-8727694602867310592, -8727694602867310592]",
"[-8726850177937178624, -8726850177937178624]",
"[-8726005753007046656, -8726005753007046656]",
"[-8725988160821002240, -8725988160821002240]",
"[-8725988160821002239, -8725979364727980033]",
"[-8725952976448913408, -8725952976448913408]",
"[-8725948578402402304, -8725948578402402304]",
"[-8725948578402402303, -8725946379379146753]",
"[-8725946379379146751, -8725944180355891201]",
"[-8725944180355891199, -8725935384262868993]",
"[-8725935384262868992, -8725935384262868992]",
"[-8725935384262868991, -8725900199890780161]",
"[-8725900199890780159, -8725865015518691329]",
"[-8723472478216650752, -8723472478216650752]",
"[-8718968878589280256, -8718968878589280256]"
],
"_id": [
"(ObjectId('ffffffffffffffffffffffff'), ObjectId('000000000000000000000000')]"
]
},
"keysExamined": 110,
"seeks": 1,
"dupsTested": 0,
"dupsDropped": 0
}
}
}
},
"command": {
"find": "myCollection",
"filter": {
"location.geoJson": {
"$geoWithin": {
"$centerSphere": [
[
-106.485,
31.7619
],
0.006308033911990311
]
}
},
"_id": {
"$lt": "ffffffffffffffffffffffff"
}
},
"sort": {
"_id": -1
},
"limit": 10,
"$db": "myDB"
},
"serverInfo": {
"host": "Isaacs-MacBook-Pro.local",
"port": 27017,
"version": "5.0.5",
"gitVersion": "d65fd89df3fc039b5c55933c0f71d647a54510ae"
},
"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