Module tidb_query_executors::util::aggr_executor[][src]

Concept:

SELECT COUNT(1), COUNT(COL) FROM TABLE GROUP BY COL+1, COL2
       ^^^^^     ^^^^^                                         : Aggregate Functions
             ^         ^^^                                     : Aggregate Function Expressions
                                                ^^^^^  ^^^^    : Group By Expressions

The SQL above has 2 GROUP BY columns, so we say it’s group by cardinality is 2.

In the result:

    COUNT(1)     COUNT(COL)         COL+1      COL2
    1            1                  1          1            <--- Each row is the result
    1            2                  1          1            <--- of a group

    ^^^^^^^^^    ^^^^^^^^^^^                                : Aggregate Result Column
                                    ^^^^^^     ^^^^^        : Group By Column

Some aggregate function output multiple results, for example, AVG(Int) output two results: count and sum. In this case we say that the result of AVG(Int) has a cardinality of 2.

Structs

AggregationExecutor

A shared executor implementation for simple aggregation, hash aggregation and stream aggregation. Implementation differences are further given via AggregationExecutorImpl.

Entities

Some common data that need to be accessed by both AggregationExecutor and AggregationExecutorImpl.

Traits

AggregationExecutorImpl