Hello,

Following an upgrade from 6.0 to 7.0 (on the same hardware resources) will also notice a significant performance drop for some query patterns that seem related to this discussion.

For instance, the following find() query below, using multiple $or conditions, provides very poor performance: ~10 seconds for MongoDB 7.0, a few tens of milliseconds for MongodBD <= 6.x. Note that the query refers to a shared collection containing 15K documents, collection size ~150MB:

We were not able to identify a 7.0 ticket referring to this kind of issue… Did anyone identify a 7.0 ticket related to that? or does anyone can share new information elements on a potential SBE performance issue?

Thank

```
{
"t": {
"$date": "2023-12-29T03:15:23.046+01:00"
},
"s": "I",
"c": "COMMAND",
"id": 51803,
"ctx": "conn101308",
"msg": "Slow query",
"attr": {
"type": "command",
"ns": "wireless.BaseStationReport",
"command": {
"find": "BaseStationReport",
"filter": {
"$or": [
{
"owID": "actility-ope-np",
"lrID": "200017C9"
},
{
"owID": "actility-ope-np",
"lrID": "200008CA"
},
{
"owID": "actility-ope-np",
"lrID": "200008D6"
},
{
"owID": "actility-ope-np",
"lrID": "200008DD"
},
{
"owID": "actility-ope-np",
"lrID": "20001800"
},
(... x58)
{
"owID": "actility-ope-np",
"lrID": "2000110D"
},
{
"owID": "actility-ope-np",
"lrID": "20001A25"
},
{
"owID": "actility-ope-np",
"lrID": "20001A25"
},
{
"owID": "actility-ope-np",
"lrID": "20001D00"
},
{
"owID": "actility-ope-np",
"lrID": "20001D0B"
},
{
"owID": "actility-ope-np",
"lrID": "20001D0B"
}
]
},
"batchSize": 200,
"singleBatch": false,
"readConcern": {
"level": "local",
"provenance": "implicitDefault"
},
"shardVersion": {
"e": {
"$oid": "6092e7608603992f012bee99"
},
"t": {
"$timestamp": {
"t": 1703235663,
"i": 1580
}
},
"v": {
"$timestamp": {
"t": 9,
"i": 3
}
}
},
"clientOperationKey": {
"$uuid": "f610edf7-5ea7-4b30-b21a-25be6ce7d1cd"
},
"lsid": {
"id": {
"$uuid": "374e7e8f-609f-4b4f-9838-59bb9c0db653"
},
"uid": {
"$binary": {
"base64": "7vqRQ3ETE3NcDKMLlrngHlRZddMqElJsfVilVRNDZSs=",
"subType": "0"
}
}
},
"$clusterTime": {
"clusterTime": {
"$timestamp": {
"t": 1703816112,
"i": 844
}
},
"signature": {
"hash": {
"$binary": {
"base64": "rLKEqaMyMayh58C265HCaP24uQ8=",
"subType": "0"
}
},
"keyId": 7280573868618549000
}
},
"$configTime": {
"$timestamp": {
"t": 1703816110,
"i": 295
}
},
"$topologyTime": {
"$timestamp": {
"t": 0,
"i": 1
}
},
"$audit": {
"$impersonatedUser": {
"user": "twa",
"db": "admin"
},
"$impersonatedRoles": [
{
"role": "readWrite",
"db": "wireless"
}
]
},
"$client": {
"driver": {
"name": "mongo-java-driver|sync|spring-boot",
"version": "4.6.1"
},
"os": {
"type": "Linux",
"name": "Linux",
"architecture": "amd64",
"version": "4.18.0-477.27.2.el8_8.x86_64"
},
"platform": "Java/Eclipse Adoptium/11.0.18+10",
"mongos": {
"host": "rd-tb-twa2:27017",
"client": "127.0.0.1:35122",
"version": "7.0.4"
}
},
"mayBypassWriteBlocking": false,
"$db": "wireless"
},
"planSummary": "IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }, IXSCAN { owID: 1, lrID: 1 }",
"planningTimeMicros": 1023,
"keysExamined": 58,
"docsExamined": 50,
"nBatches": 1,
"cursorExhausted": true,
"numYields": 891,
"nreturned": 50,
"queryHash": "64E4A6F9",
"planCacheKey": "E679585C",
"queryFramework": "sbe",
"reslen": 668936,
"locks": {
"FeatureCompatibilityVersion": {
"acquireCount": {
"r": 892
}
},
"Global": {
"acquireCount": {
"r": 892
}
},
"Mutex": {
"acquireCount": {
"r": 1203
}
}
},
"readConcern": {
"level": "local",
"provenance": "implicitDefault"
},
"storage": {
"data": {
"bytesRead": 58221,
"bytesWritten": 1338531,
"timeReadingMicros": 15,
"timeWritingMicros": 1821284
},
"timeWaitingMicros": {
"cache": 4692915
}
},
"cpuNanos": 2107668910,
"remote": "192.168.151.19:59538",
"protocol": "op_msg",
"durationMillis": 10387
}
}
```

Blockquote