you are right - my mistake.
i have changed the date indexes to descending to try and squeeze more speed out of the query but it didnt do anything
"executionStats": {
"executionSuccess": true,
"nReturned": 5376753,
"executionTimeMillis": 13878,
"totalKeysExamined": 5376753,
"totalDocsExamined": 5376753,
"executionStages": {
"isCached": false,
"stage": "FETCH",
"nReturned": 5376753,
"executionTimeMillisEstimate": 13428,
"works": 5376754,
"advanced": 5376753,
"needTime": 0,
"needYield": 0,
"saveState": 741,
"restoreState": 741,
"isEOF": 1,
"docsExamined": 5376753,
"alreadyHasObj": 0,
"inputStage": {
"stage": "IXSCAN",
"nReturned": 5376753,
"executionTimeMillisEstimate": 3647,
"works": 5376754,
"advanced": 5376753,
"needTime": 0,
"needYield": 0,
"saveState": 741,
"restoreState": 741,
"isEOF": 1,
"keyPattern": {
"date": -1
},
"indexName": "date_-1",
"isMultiKey": false,
"multiKeyPaths": {
"date": []
},
"isUnique": false,
"isSparse": false,
"isPartial": false,
"indexVersion": 2,
"direction": "forward",
"indexBounds": {
"date": [
"[new Date(1748303999999), new Date(1745837512346)]"
]
},
"keysExamined": 5376753,
"seeks": 1,
"dupsTested": 0,
"dupsDropped": 0
}
},
"allPlansExecution": []
},
FETCH stage takes 13 sec while the IXSCAN takes additional 3,6s
Is there any chance to improvie the speed of queries selecting data by date ranges?