Jira Link: DB-1655
Currently the query-layer-independent part of the DocDB scan is not aware of aggregate queries, and it wastes ~10% of total CPU time building subdocuments that will be immediately discarded. We should skip this step for queries that do not actually use the constructed subdocument.
There are some aggregate queries that will still need the subdocument values, like those that find the min/max or skip rows with null columns, so we can only skip building the subdocument in specific cases (like those seen in COUNT(*)).
Jira Link: DB-1655 Currently the query-layer-independent part of the DocDB scan is not aware of aggregate queries, and it wastes ~10% of total CPU time building subdocuments that will be immediately discarded. We should skip this step for queries that do not actually use the constructed subdocument.
There are some aggregate queries that will still need the subdocument values, like those that find the min/max or skip rows with null columns, so we can only skip building the subdocument in specific cases (like those seen in
COUNT(*)
).