I’m trying to understand more on the slow query data log. In some of the slow queries, I saw some queries has both high “keys examined” & “docs examples” & “used indexes = true”. Does it suggest an efficient index-based query?
Here is an example of the query we have:
{
"type": "command",
"ns": "profiles.profiles",
"command": {
"find": "profiles",
"filter": {
"wallets.network": {
"$exists": true,
"$eq": "ETHEREUM"
},
"wallets.address": {
"$exists": true,
"$eq": "0x0000000000000000000000000000000000000000"
}
},
"limit": 1,
"singleBatch": true,
"readConcern": {
"level": "snapshot"
},
"lsid": {
"id": {
"$binary": {
"base64": "G3/CI549RUmynPncgQoy9Q==",
"subType": "04"
}
}
},
"txnNumber": 47622,
"startTransaction": true,
"autocommit": false,
"$clusterTime": {
"clusterTime": {
"$timestamp": {
"t": 1698949046,
"i": 3
}
},
"signature": {
"hash": {
"$binary": {
"base64": "BnzSwRPGSbjI5v8SFjck/2kQ4AA=",
"subType": "00"
}
},
"keyId": 7237555922858410000
}
},
"$db": "profiles",
"$readPreference": {
"mode": "primary"
}
},
"planSummary": "IXSCAN { wallets.network: 1, wallets.address: 1 }",
"planningTimeMicros": 117,
"keysExamined": 16402,
"docsExamined": 14633,
"fromPlanCache": true,
"nBatches": 1,
"cursorExhausted": true,
"numYields": 0,
"nreturned": 0,
"queryHash": "0D3949B0",
"planCacheKey": "2E2ECD8F",
"queryFramework": "sbe",
"reslen": 231,
"locks": {},
"readConcern": {
"level": "snapshot",
"provenance": "clientSupplied"
},
"storage": {},
"cpuNanos": 52353796,
"remote": "3.134.126.8:2830",
"protocol": "op_msg",
"durationMillis": 105,
"v": "7.0.2"
}