Details
-
Task
-
Resolution: Fixed
-
Major - P3
-
None
-
None
-
None
-
Fully Compatible
-
100
Description
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.
Attachments
Issue Links
- depends on
-
SERVER-70871 Generate query solution before query engine selection
-
- Closed
-
- related to
-
SERVER-52958 [SBE] Add support for the COUNT_SCAN stage to the SBE stage builders
-
- Closed
-
-
SERVER-71485 Better naming for CanonicalQuery::isCount
-
- Closed
-