|
Currently, count queries do not use SBE. This prevents any count-like query from using the column index, such asĀ
db.order_lineitem.aggregate(
|
[
|
{
|
$match: {
|
$and: [
|
{ "order.o_orderdate": { $gte: ISODate("1992-01-01") } },
|
{ "order.o_orderdate": { $lte: ISODate("1996-01-01") } },
|
{ l_discount: { $gte: 0.1 } },
|
{ l_discount: { $lte: 0.3 } }
|
],
|
l_quantity: {
|
$lte: 25
|
}
|
},
|
},
|
{
|
$group: {
|
_id: 1,
|
count: {
|
$sum: 1
|
}
|
}
|
}
|
]
|
)
|
This ticket is to allow queries to use SBE for counts when an eligible column index is available. Doing this in a somewhat clean way will be tricky, because we have to choose the engine based on what indexes are available.
|