

I got the binary from follwing url then strip it

```
wget -c https://builds.clickhouse.tech/master/aarch64/clickhouse

kylin@kylin-gtj:~$ strip clickhouse
kylin@kylin-gtj:~$ ll cl*
-rw-r--r-- 1 kylin kylin 234645184 5月  13 08:21 clickhouse
kylin@kylin-gtj:~$ cd ch
kylin@kylin-gtj:~/ch$ ll
总用量 242132
drwxrwxr-x 13 kylin kylin      4096 5月  11 16:28 ./
drwx------ 39 kylin kylin      4096 5月  13 08:21 ../
-rwxrwxr-x  1 kylin kylin 219328512 3月  26 15:24 clickhouse*
drwxr-x---  6 kylin kylin      4096 5月  11 13:56 data/
drwxr-x---  2 kylin kylin      4096 3月  26 15:25 dictionaries_lib/
drwxr-x---  2 kylin kylin      4096 3月  26 15:25 flags/
drwxr-x---  2 kylin kylin      4096 3月  26 15:25 format_schemas/
drwxr-x---  2 kylin kylin      4096 3月  30 09:45 metadata/
drwxr-x---  2 kylin kylin      4096 4月  29 13:31 metadata_dropped/
-rw-------  1 kylin kylin  28550256 5月  11 16:28 nohup.out
drwxr-x---  2 kylin kylin      4096 3月  26 15:25 preprocessed_configs/
drwxr-x---  4 kylin kylin      4096 4月   8 09:47 shadow/
drwxr-x--- 53 kylin kylin      4096 4月  29 13:23 store/
drwxr-x---  3 kylin kylin      4096 3月  31 12:50 tmp/
drwxr-x---  2 kylin kylin      4096 3月  26 15:25 user_files/
```

then rename the old binary file to clickhouse214 and satrt new file and run a query.

```
kylin@kylin-gtj:~/ch$ mv clickhouse clickhouse214
kylin@kylin-gtj:~/ch$ mv ../clickhouse .
kylin@kylin-gtj:~/ch$ chmod +x clickhouse
kylin@kylin-gtj:~/ch$ nohup ./clickhouse server &
[1] 3369
kylin@kylin-gtj:~/ch$ nohup: 忽略输入并把输出追加到'nohup.out'

kylin@kylin-gtj:~/ch$ mysql --protocol tcp -u default -P 9004
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 0
Server version: 21.6.1.6818-ClickHouse 

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use pop
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

mysql> with t as(
    -> select  agg,age1,d6,d4,count(*)cnt from ren group by cube(agg,age1,d6,d4)), 
    -> st as (
    -> select agg,age1,d6,d4 from aggs,age1s,d6s,d4s where age1=0 or toUInt8((age1+4)/5)=agg order by d6,d4)
    -> select agg,age1,arraySlice(groupArray(cnt),1,10)ac from st left join t using(agg,age1,d6,d4) group by agg,age1 order by agg,age1
    -> ;
+------+------+---------------------------------------------------------------------------------------+
| agg  | age1 | ac                                                                                    |
+------+------+---------------------------------------------------------------------------------------+
126 rows in set (9.99 sec)
Read 128000189 rows, 2.01 GiB in 9.98721409 sec., 12816405 rows/sec., 205.82 MiB/sec.

mysql> explain with t as( select  agg,age1,d6,d4,count(*)cnt from ren group by cube(agg,age1,d6,d4)),  st as ( select agg,age1,d6,d4 from aggs,age1s,d6s,d4s where age1=0 or toUInt8((age1+4)/5)=agg order by d6,d4) select agg,age1,arraySlice(groupArray(cnt),1,10)ac from st left join t using(agg,age1,d6,d4) group by agg,age1 order by agg,age1;
+------------------------------------------------------------------------------------------------------------------------------------+
| explain                                                                                                                            |
+------------------------------------------------------------------------------------------------------------------------------------+
| Expression (Projection)                                                                                                            |
|   MergingSorted (Merge sorted streams for ORDER BY)                                                                                |
|     MergeSorting (Merge sorted blocks for ORDER BY)                                                                                |
|       PartialSorting (Sort each block for ORDER BY)                                                                                |
|         Expression (Before ORDER BY)                                                                                               |
|           Aggregating                                                                                                              |
|             Expression (Before GROUP BY)                                                                                           |
|               Join (JOIN)                                                                                                          |
|                 Expression ((Before JOIN + Projection))                                                                            |
|                   MergingSorted (Merge sorted streams for ORDER BY)                                                                |
|                     MergeSorting (Merge sorted blocks for ORDER BY)                                                                |
|                       PartialSorting (Sort each block for ORDER BY)                                                                |
|                         Expression (Before ORDER BY)                                                                               |
|                           Filter (WHERE)                                                                                           |
|                             Join (JOIN)                                                                                            |
|                               Expression ((Before JOIN + (Projection + Before ORDER BY)))                                          |
|                                 Filter (WHERE)                                                                                     |
|                                   Join (JOIN)                                                                                      |
|                                     Expression ((Before JOIN + (Projection + Before ORDER BY)))                                    |
|                                       Filter (WHERE)                                                                               |
|                                         Join (JOIN)                                                                                |
|                                           Expression (Before JOIN)                                                                 |
|                                             SettingQuotaAndLimits (Set limits and quota after reading from storage)                |
|                                               ReadFromStorage (Log)                                                                |
|                                           Expression ((Joined actions + (Rename joined columns + (Projection + Before ORDER BY)))) |
|                                             SettingQuotaAndLimits (Set limits and quota after reading from storage)                |
|                                               ReadFromStorage (Log)                                                                |
|                                     Expression ((Joined actions + (Rename joined columns + (Projection + Before ORDER BY))))       |
|                                       SettingQuotaAndLimits (Set limits and quota after reading from storage)                      |
|                                         ReadFromStorage (Log)                                                                      |
|                               Expression ((Joined actions + (Rename joined columns + (Projection + Before ORDER BY))))             |
|                                 SettingQuotaAndLimits (Set limits and quota after reading from storage)                            |
|                                   ReadFromStorage (Log)                                                                            |
|                 Expression ((Joined actions + (Rename joined columns + (Projection + Before ORDER BY))))                           |
|                   Cube                                                                                                             |
|                     Aggregating                                                                                                    |
|                       Expression (Before GROUP BY)                                                                                 |
|                         SettingQuotaAndLimits (Set limits and quota after reading from storage)                                    |
|                           ReadFromMergeTree                                                                                        |
+------------------------------------------------------------------------------------------------------------------------------------+
39 rows in set (0.00 sec)
Read 39 rows, 2.82 KiB in 0.00643683 sec., 6058 rows/sec., 438.30 KiB/sec.


```
the query took about 10 seconds, but each of the sub-query are all very fast (ren has 128000000 rows, t has 7917 rows, and st has 22302 rows )
```
mysql> with t as( select  agg,age1,d6,d4,count(*)cnt from ren group by cube(agg,age1,d6,d4))select count(*) from t;
+---------+
| count() |
+---------+
|    7917 |
+---------+
1 row in set (1.33 sec)
Read 128000000 rows, 2.01 GiB in 1.32724088 sec., 96440670 rows/sec., 1.51 GiB/sec.

mysql> with st as ( select agg,age1,d6,d4 from aggs,age1s,d6s,d4s where age1=0 or toUInt8((age1+4)/5)=agg order by d6,d4)select count(*) from st;
+---------+
| count() |
+---------+
|   22302 |
+---------+
1 row in set (0.01 sec)
Read 189 rows, 189.00 B in 0.01041345 sec., 18149 rows/sec., 17.72 KiB/sec.

mysql> select count(*) from ren;
+-----------+
| count()   |
+-----------+
| 128000000 |
+-----------+
1 row in set (0.00 sec)
Read 1 rows, 4.01 KiB in 0.00057369 sec., 1743 rows/sec., 6.82 MiB/sec.
```
then I quit the version: 21.6, restart the version 2.14.
the same query took about 1.4 seconds. 

```
kylin@kylin-gtj:~/ch$ pgrep clickhouse
3370
kylin@kylin-gtj:~/ch$ kill 3370
kylin@kylin-gtj:~/ch$ pgrep clickhouse
[1]+  已完成               nohup ./clickhouse server
kylin@kylin-gtj:~/ch$ nohup ./clickhouse214 server &
[1] 3931
kylin@kylin-gtj:~/ch$ nohup: 忽略输入并把输出追加到'nohup.out'

kylin@kylin-gtj:~/ch$ mysql --protocol tcp -u default -P 9004
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 0
Server version: 21.4.1.6351-ClickHouse 

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use pop
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> with t as( select  agg,age1,d6,d4,count(*)cnt from ren group by cube(agg,age1,d6,d4)),  st as ( select agg,age1,d6,d4 from aggs,age1s,d6s,d4s where age1=0 or toUInt8((age1+4)/5)=agg order by d6,d4) select agg,age1,arraySlice(groupArray(cnt),1,10)ac from st left join t using(agg,age1,d6,d4) group by agg,age1 order by agg,age1;
+------+------+---------------------------------------------------------------------------------------+
| agg  | age1 | ac                                                                                    |
+------+------+---------------------------------------------------------------------------------------+
126 rows in set (1.41 sec)
Read 128000189 rows, 2.01 GiB in 1.40947438 sec., 90814129 rows/sec., 1.42 GiB/sec.

mysql> select count(*) from ren;
+-----------+
| count()   |
+-----------+
| 128000000 |
+-----------+
1 row in set (0.00 sec)
Read 1 rows, 4.01 KiB in 0.00055921 sec., 1788 rows/sec., 7.00 MiB/sec.

mysql> with st as ( select agg,age1,d6,d4 from aggs,age1s,d6s,d4s where age1=0 or toUInt8((age1+4)/5)=agg order by d6,d4)select count(*) from st;
+---------+
| count() |
+---------+
|   22302 |
+---------+
1 row in set (0.01 sec)
Read 189 rows, 189.00 B in 0.00977349 sec., 19338 rows/sec., 18.88 KiB/sec.

mysql> with t as( select  agg,age1,d6,d4,count(*)cnt from ren group by cube(agg,age1,d6,d4))select count(*) from t;
+---------+
| count() |
+---------+
|    7917 |
+---------+
1 row in set (1.33 sec)
Read 128000000 rows, 2.01 GiB in 1.33491026 sec., 95886595 rows/sec., 1.50 GiB/sec.

mysql> explain with t as( select  agg,age1,d6,d4,count(*)cnt from ren group by cube(agg,age1,d6,d4)),  st as ( select agg,age1,d6,d4 from aggs,age1s,d6s,d4s where age1=0 or toUInt8((age1+4)/5)=agg order by d6,d4) select agg,age1,arraySlice(groupArray(cnt),1,10)ac from st left join t using(agg,age1,d6,d4) group by agg,age1 order by agg,age1;
+---------------------------------------------------------------------------------------------------------------------------------+
| explain                                                                                                                         |
+---------------------------------------------------------------------------------------------------------------------------------+
| Expression (Projection)                                                                                                         |
|   MergingSorted (Merge sorted streams for ORDER BY)                                                                             |
|     MergeSorting (Merge sorted blocks for ORDER BY)                                                                             |
|       PartialSorting (Sort each block for ORDER BY)                                                                             |
|         Expression (Before ORDER BY)                                                                                            |
|           CreatingSets (Create sets before main query execution)                                                                |
|             Aggregating                                                                                                         |
|               Expression (Before GROUP BY)                                                                                      |
|                 Join (JOIN)                                                                                                     |
|                   Expression ((Before JOIN + Projection))                                                                       |
|                     MergingSorted (Merge sorted streams for ORDER BY)                                                           |
|                       MergeSorting (Merge sorted blocks for ORDER BY)                                                           |
|                         PartialSorting (Sort each block for ORDER BY)                                                           |
|                           CreatingSets (Create sets before main query execution)                                                |
|                             Expression (Before ORDER BY)                                                                        |
|                               Filter (WHERE)                                                                                    |
|                                 Join (JOIN)                                                                                     |
|                                   Expression ((Before JOIN + Projection))                                                       |
|                                     CreatingSets (Create sets before main query execution)                                      |
|                                       Expression (Before ORDER BY)                                                              |
|                                         Filter (WHERE)                                                                          |
|                                           Join (JOIN)                                                                           |
|                                             Expression ((Before JOIN + Projection))                                             |
|                                               CreatingSets (Create sets before main query execution)                            |
|                                                 Expression (Before ORDER BY)                                                    |
|                                                   Filter (WHERE)                                                                |
|                                                     Join (JOIN)                                                                 |
|                                                       Expression (Before JOIN)                                                  |
|                                                         SettingQuotaAndLimits (Set limits and quota after reading from storage) |
|                                                           ReadFromStorage (Log)                                                 |
|                                                 CreatingSet (Create set for JOIN)                                               |
|                                                   Expression ((Projection + Before ORDER BY))                                   |
|                                                     SettingQuotaAndLimits (Set limits and quota after reading from storage)     |
|                                                       ReadFromStorage (Log)                                                     |
|                                       CreatingSet (Create set for JOIN)                                                         |
|                                         Expression ((Projection + Before ORDER BY))                                             |
|                                           SettingQuotaAndLimits (Set limits and quota after reading from storage)               |
|                                             ReadFromStorage (Log)                                                               |
|                             CreatingSet (Create set for JOIN)                                                                   |
|                               Expression ((Projection + Before ORDER BY))                                                       |
|                                 SettingQuotaAndLimits (Set limits and quota after reading from storage)                         |
|                                   ReadFromStorage (Log)                                                                         |
|             CreatingSet (Create set for JOIN)                                                                                   |
|               Expression ((Projection + Before ORDER BY))                                                                       |
|                 Cube                                                                                                            |
|                   Aggregating                                                                                                   |
|                     Expression (Before GROUP BY)                                                                                |
|                       SettingQuotaAndLimits (Set limits and quota after reading from storage)                                   |
|                         ReadFromStorage (MergeTree)                                                                             |
+---------------------------------------------------------------------------------------------------------------------------------+
49 rows in set (0.01 sec)
Read 49 rows, 3.56 KiB in 0.00660192 sec., 7422 rows/sec., 538.58 KiB/sec.
```



		
utFormat::PortKind::Main).getOutputPort().getProcessor();
            if (visited.emplace(child_processor).second)
                queue.push({ child_processor, visited_limit });
            continue;
        }
        for (auto & child_port : processor->getInputs())
        {
            auto * child_processor = &child_port.getOutputPort().getProcessor();
            if (visited.emplace(child_processor).second)
                queue.push({ child_processor, visited_limit });
        }
    }
    if (!rows_before_limit_at_least && (!limits.empty() || !sources.empty() || !remote_sources.empty()))
    {
        rows_before_limit_at_least = std::make_shared<RowsBeforeLimitCounter>();
        for (auto & limit : limits)
            limit->setRowsBeforeLimitCounter(rows_before_limit_at_least);
        for (auto & source : sources)
            source->setRowsBeforeLimitCounter(rows_before_limit_at_least);
        for (auto & source : remote_sources)
            source->setRowsBeforeLimitCounter(rows_before_limit_at_least);
    }
    /// If there is a limit, then enable rows_before_limit_at_least
    /// It is needed when zero rows is read, but we still want rows_before_limit_at_least in result.
    if (!limits.empty())
        rows_before_limit_at_least->add(0);
    if (rows_before_limit_at_least)
        output_format->setRowsBeforeLimitCounter(rows_before_limit_at_least);
}
PipelineExecutorPtr QueryPipeline::execute()