compound index
{
A: 1,
timestamp: 1,
}
and
{
B: 1,
timestamp: 1,
}
db.user.aggregate([
{ $match: {
$or: [ { A: "some_value" }, { B: "some_value" } ]
} },
{
$sort: {
timestamp: 1
}
},
{
$limit: 1000
}
])
In the $match, will mongoDB check the two indices concurrently?