Hi,
I have the below query which is very slow on a collection of about 2M documents. I believe it is due to the ‘retracted=null’ filter (if I remove it the query is fast). I have the following indexes: retracted_1_date_-1_feedCode_1
and
retracted_1_date_-1_feedCodes_1_feedCode_1_status_1
Oddly enough the first one seems to be the one that’s used as the second one shows zero uses (which is strage since status is part of the query).
It should be note that the vast majority of documents have retracted missing null (the field is actually missing), but based on what I read that should not make a difference. Any ideas why this query is so slow? Thanks.
"find": "stories",
"filter": {
"retracted": {
"$eq": null
},
"status": {
"$in": [
1,
null
]
},
"$or": [
{
"feedCode": {
"$in": [
"EVERT"
]
}
},
{
"feedCodes": {
"$in": [
"EVERT"
]
}
}
]
},
"sort": {
"date": -1
},
"projection": {
"body": 0
},
"limit": 21,