# Review `StreamAgg` in the Execution Plan 

```
tidb> EXPLAIN SELECT MIN(hire_date) FROM employees;
+-----------------------+-----------+-----------+-----------------+----------------------------------------------------+
| id                    | estRows   | task      | access object   | operator info                                      |
+-----------------------+-----------+-----------+-----------------+----------------------------------------------------+
| ~!@StreamAgg_9@!~           | 1.00      | root      |                 | funcs:min(employees.employees.hire_date)->Column#7 |
| └─TopN_10             | 1.00      | root      |                 | employees.employees.hire_date, offset:0, count:1   |
|  └─TableReader_17     | 1.00      | root      |                 | data:TopN_16                                       |
|   └─TopN_16           | 1.00      | cop[tikv] |                 | employees.employees.hire_date, offset:0, count:1   |
|    └─TableFullScan_15 | 300024.00 | cop[tikv] | table:employees | keep order:false                                   |
+-----------------------+-----------+-----------+-----------------+----------------------------------------------------+
5 rows in set (0.00 sec)
```

------------------------------------------------------------------------------
Reviewing the execution plan:

1. `TableFullScan_15` (Line 5): This step scans the `employees` table across various TiKV nodes. Since the `hire_date` values are unordered, a sorting operation is needed.
   
2. `TopN_16` (Line 4): To efficiently find the minimum value, this step retrieves the smallest value from the sorted data on TiKV nodes.

3. `TableReader_17` (Line 3): Each TiKV node sends the top sorted value for `hire_date` to the TiDB Server. This step involves table scanning.

4. `TopN_10` (Line 2): The TiDB Server aggregates data from different TiKV nodes and performs additional sorting if necessary.

5. `StreamAgg_9` (Line 1): Finally, the TiDB Server uses the `StreamAgg` operator to retrieve the minimum value.