From d424aa8dccb3e6f5c03019a7cdff3b03ec2568b6 Mon Sep 17 00:00:00 2001 From: AilinKid <314806019@qq.com> Date: Fri, 9 Aug 2024 15:35:25 +0800 Subject: [PATCH 1/7] . Signed-off-by: AilinKid <314806019@qq.com> --- explain-aggregation.md | 2 +- functions-and-operators/group-by-modifier.md | 31 +++++++++++++++----- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/explain-aggregation.md b/explain-aggregation.md index a0985cb748137..1d4b863a1b649 100644 --- a/explain-aggregation.md +++ b/explain-aggregation.md @@ -179,7 +179,7 @@ In the `GROUP BY` clause, you can specify one or more columns as a group list an > **Note:** > -> Currently, TiDB does not support the Cube syntax, and TiDB supports generating valid execution plans for the `WITH ROLLUP` syntax only in TiFlash MPP mode. +> Currently, TiDB does not support the Cube syntax. ```sql explain SELECT year, month, grouping(year), grouping(month), SUM(profit) AS profit FROM bank GROUP BY year, month WITH ROLLUP; diff --git a/functions-and-operators/group-by-modifier.md b/functions-and-operators/group-by-modifier.md index 710758e14387a..5c0d937b5f966 100644 --- a/functions-and-operators/group-by-modifier.md +++ b/functions-and-operators/group-by-modifier.md @@ -36,13 +36,11 @@ Aggregating and summarizing data from multiple columns is commonly used in OLAP ## Prerequisites -Currently, TiDB supports generating valid execution plans for the `WITH ROLLUP` syntax only in TiFlash MPP mode. Therefore, make sure that your TiDB cluster has been deployed with TiFlash nodes and that target fact tables are configured with TiFlash replicas properly. +In versions prior to v8.3.0, TiDB only supports generating valid execution plans for the `WITH ROLLUP` syntax in [TiFlash MPP mode](/tiflash/use-tiflash-mpp-mode.md). Therefore, your TiDB cluster needs to contain TiFlash nodes, and the target analysis table must be configured with the correct TiFlash replica. For more information, please refer to [Expanding TiFlash Node](/scale-tidb-using-tiup.md#Scale-out-a-TiFlash-cluster). - +Starting with v8.3.0, the above restrictions have been removed. Regardless of whether the TiDB cluster contains TiFlash nodes or not, TiDB supports generating valid execution plans for the `WITH ROLLUP` syntax. -For more information, see [Scale out a TiFlash cluster](/scale-tidb-using-tiup.md#scale-out-a-tiflash-cluster). - - +You can tell the storage engine that executes the `Expand` operator through the `task` attribute of the `Expand` operator in the execution plan. For more information, please refer to [How to interpret the ROLLUP execution plan](#How-to-interpret-the-ROLLUP-execution-plan). ## Examples @@ -57,7 +55,7 @@ CREATE TABLE bank profit DECIMAL(13, 7) ); -ALTER TABLE bank SET TIFLASH REPLICA 1; -- Add a TiFlash replica for the table +ALTER TABLE bank SET TIFLASH REPLICA 1; -- 在 TiFlash MPP 模式下,为该表添加一个 TiFlash 副本 INSERT INTO bank VALUES(2000, "Jan", 1, 10.3),(2001, "Feb", 2, 22.4),(2000,"Mar", 3, 31.6) ``` @@ -166,10 +164,27 @@ To meet the requirements of multidimensional grouping, multidimensional data agg The implementation of the `Expand` operator is similar to that of the `Projection` operator. The difference is that `Expand` is a multi-level `Projection`, which contains multiple levels of projection operation expressions. For each row of the raw data, the `Projection` operator generates only one row in results, whereas the `Expand` operator generates multiple rows in results (the number of rows is equal to the number of levels in projection operation expressions). -The following is an example of an execution plan: + +The following is an example of an execution plan for a TiDB cluster that does not contain TiFlash nodes. The `task` of the `Expand` operator is `root`, which means that the `Expand` operator is executed in TiDB: +```sql +EXPLAIN SELECT year, month, grouping(year), grouping(month), SUM(profit) AS profit FROM bank GROUP BY year, month WITH ROLLUP; ++--------------------------------+---------+-----------+---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| id | estRows | task | access object | operator info | ++--------------------------------+---------+-----------+---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| Projection_7 | 2.40 | root | | Column#6->Column#12, Column#7->Column#13, grouping(gid)->Column#14, grouping(gid)->Column#15, Column#9->Column#16 | +| └─HashAgg_8 | 2.40 | root | | group by:Column#6, Column#7, gid, funcs:sum(test.bank.profit)->Column#9, funcs:firstrow(Column#6)->Column#6, funcs:firstrow(Column#7)->Column#7, funcs:firstrow(gid)->gid | +| └─Expand_12 | 3.00 | root | | level-projection:[test.bank.profit, ->Column#6, ->Column#7, 0->gid],[test.bank.profit, Column#6, ->Column#7, 1->gid],[test.bank.profit, Column#6, Column#7, 3->gid]; schema: [test.bank.profit,Column#6,Column#7,gid] | +| └─Projection_14 | 3.00 | root | | test.bank.profit, test.bank.year->Column#6, test.bank.month->Column#7 | +| └─TableReader_16 | 3.00 | root | | data:TableFullScan_15 | +| └─TableFullScan_15 | 3.00 | cop[tikv] | table:bank | keep order:false, stats:pseudo | ++--------------------------------+---------+-----------+---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +6 rows in set (0.00 sec) +``` + +The following is an example of the execution plan via TiFlash MPP mode, in which the `task` of the `Expand` operator is `mpp[tiflash]`, which means that the `Expand` operator is executed in TiFlash: ```sql -explain SELECT year, month, grouping(year), grouping(month), SUM(profit) AS profit FROM bank GROUP BY year, month WITH ROLLUP; +EXPLAIN SELECT year, month, grouping(year), grouping(month), SUM(profit) AS profit FROM bank GROUP BY year, month WITH ROLLUP; +----------------------------------------+---------+--------------+---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | id | estRows | task | access object | operator info | +----------------------------------------+---------+--------------+---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ From 8d5a0ea667df032a468d9509c703ead86f1d32bc Mon Sep 17 00:00:00 2001 From: AilinKid <314806019@qq.com> Date: Fri, 9 Aug 2024 16:14:55 +0800 Subject: [PATCH 2/7] . Signed-off-by: AilinKid <314806019@qq.com> --- functions-and-operators/group-by-modifier.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions-and-operators/group-by-modifier.md b/functions-and-operators/group-by-modifier.md index 5c0d937b5f966..3d99ab3a7ed30 100644 --- a/functions-and-operators/group-by-modifier.md +++ b/functions-and-operators/group-by-modifier.md @@ -36,11 +36,11 @@ Aggregating and summarizing data from multiple columns is commonly used in OLAP ## Prerequisites -In versions prior to v8.3.0, TiDB only supports generating valid execution plans for the `WITH ROLLUP` syntax in [TiFlash MPP mode](/tiflash/use-tiflash-mpp-mode.md). Therefore, your TiDB cluster needs to contain TiFlash nodes, and the target analysis table must be configured with the correct TiFlash replica. For more information, please refer to [Expanding TiFlash Node](/scale-tidb-using-tiup.md#Scale-out-a-TiFlash-cluster). +In versions prior to v8.3.0, TiDB only supports generating valid execution plans for the `WITH ROLLUP` syntax in [TiFlash MPP mode](/tiflash/use-tiflash-mpp-mode.md). Therefore, your TiDB cluster needs to contain TiFlash nodes, and the target analysis table must be configured with the correct TiFlash replica. For more information, please refer to [Expanding TiFlash Node](/scale-tidb-using-tiup.md#scale-out-a-tiflash-cluster). Starting with v8.3.0, the above restrictions have been removed. Regardless of whether the TiDB cluster contains TiFlash nodes or not, TiDB supports generating valid execution plans for the `WITH ROLLUP` syntax. -You can tell the storage engine that executes the `Expand` operator through the `task` attribute of the `Expand` operator in the execution plan. For more information, please refer to [How to interpret the ROLLUP execution plan](#How-to-interpret-the-ROLLUP-execution-plan). +You can tell the storage engine that executes the `Expand` operator through the `task` attribute of the `Expand` operator in the execution plan. For more information, please refer to [How to interpret the ROLLUP execution plan](#how-to-interpret-the-rollup-execution-plan). ## Examples From 070b465c41bc7a4432d82e40d878a3244baa52c3 Mon Sep 17 00:00:00 2001 From: Aolin Date: Fri, 9 Aug 2024 18:22:32 +0800 Subject: [PATCH 3/7] refine wording and make CI happy --- functions-and-operators/group-by-modifier.md | 22 ++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/functions-and-operators/group-by-modifier.md b/functions-and-operators/group-by-modifier.md index 3d99ab3a7ed30..44bf6422b4598 100644 --- a/functions-and-operators/group-by-modifier.md +++ b/functions-and-operators/group-by-modifier.md @@ -36,11 +36,21 @@ Aggregating and summarizing data from multiple columns is commonly used in OLAP ## Prerequisites -In versions prior to v8.3.0, TiDB only supports generating valid execution plans for the `WITH ROLLUP` syntax in [TiFlash MPP mode](/tiflash/use-tiflash-mpp-mode.md). Therefore, your TiDB cluster needs to contain TiFlash nodes, and the target analysis table must be configured with the correct TiFlash replica. For more information, please refer to [Expanding TiFlash Node](/scale-tidb-using-tiup.md#scale-out-a-tiflash-cluster). + -Starting with v8.3.0, the above restrictions have been removed. Regardless of whether the TiDB cluster contains TiFlash nodes or not, TiDB supports generating valid execution plans for the `WITH ROLLUP` syntax. +Before v8.3.0, TiDB only supports generating valid execution plans for the `WITH ROLLUP` syntax in [TiFlash MPP mode](/tiflash/use-tiflash-mpp-mode.md). Therefore, your TiDB cluster needs to contain TiFlash nodes, and the target table must be configured with the correct TiFlash replica. For more information, see [Scale out a TiFlash cluster](/scale-tidb-using-tiup.md#scale-out-a-tiflash-cluster). -You can tell the storage engine that executes the `Expand` operator through the `task` attribute of the `Expand` operator in the execution plan. For more information, please refer to [How to interpret the ROLLUP execution plan](#how-to-interpret-the-rollup-execution-plan). + + + + +Before v8.3.0, TiDB only supports generating valid execution plans for the `WITH ROLLUP` syntax in [TiFlash MPP mode](/tiflash/use-tiflash-mpp-mode.md). Therefore, your TiDB cluster needs to contain TiFlash nodes, and the target table must be configured with the correct TiFlash replica. For more information, see [Scale out a TiFlash cluster](https://docs.pingcap.com/tidb/stable/scale-tidb-using-tiup#scale-out-a-tiflash-cluster). + + + +Starting from v8.3.0, the preceding limitation is removed. Regardless of whether the TiDB cluster contains TiFlash nodes, TiDB supports generating valid execution plans for the `WITH ROLLUP` syntax. + +You can determine the storage engine that executes the `Expand` operator by checking the `task` attribute of the `Expand` operator in the execution plan. For more information, see [How to interpret the ROLLUP execution plan](#how-to-interpret-the-rollup-execution-plan). ## Examples @@ -55,7 +65,7 @@ CREATE TABLE bank profit DECIMAL(13, 7) ); -ALTER TABLE bank SET TIFLASH REPLICA 1; -- 在 TiFlash MPP 模式下,为该表添加一个 TiFlash 副本 +ALTER TABLE bank SET TIFLASH REPLICA 1; -- Add a TiFlash replica for the table in TiFlash MPP mode. INSERT INTO bank VALUES(2000, "Jan", 1, 10.3),(2001, "Feb", 2, 22.4),(2000,"Mar", 3, 31.6) ``` @@ -164,8 +174,8 @@ To meet the requirements of multidimensional grouping, multidimensional data agg The implementation of the `Expand` operator is similar to that of the `Projection` operator. The difference is that `Expand` is a multi-level `Projection`, which contains multiple levels of projection operation expressions. For each row of the raw data, the `Projection` operator generates only one row in results, whereas the `Expand` operator generates multiple rows in results (the number of rows is equal to the number of levels in projection operation expressions). +The following example shows the execution plan for a TiDB cluster that does not contain TiFlash nodes, where the `task` of the `Expand` operator is `root`, indicating that the `Expand` operator is executed in TiDB: -The following is an example of an execution plan for a TiDB cluster that does not contain TiFlash nodes. The `task` of the `Expand` operator is `root`, which means that the `Expand` operator is executed in TiDB: ```sql EXPLAIN SELECT year, month, grouping(year), grouping(month), SUM(profit) AS profit FROM bank GROUP BY year, month WITH ROLLUP; +--------------------------------+---------+-----------+---------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -181,7 +191,7 @@ EXPLAIN SELECT year, month, grouping(year), grouping(month), SUM(profit) AS prof 6 rows in set (0.00 sec) ``` -The following is an example of the execution plan via TiFlash MPP mode, in which the `task` of the `Expand` operator is `mpp[tiflash]`, which means that the `Expand` operator is executed in TiFlash: +The following example shows the execution plan in TiFlash MPP mode, where the `task` of the `Expand` operator is `mpp[tiflash]`, indicating that the `Expand` operator is executed in TiFlash: ```sql EXPLAIN SELECT year, month, grouping(year), grouping(month), SUM(profit) AS profit FROM bank GROUP BY year, month WITH ROLLUP; From 1f84af04b061001d216cc32917f2f362e2523711 Mon Sep 17 00:00:00 2001 From: AilinKid <314806019@qq.com> Date: Tue, 13 Aug 2024 11:26:06 +0800 Subject: [PATCH 4/7] . Signed-off-by: AilinKid <314806019@qq.com> --- functions-and-operators/group-by-modifier.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions-and-operators/group-by-modifier.md b/functions-and-operators/group-by-modifier.md index 44bf6422b4598..f9cd0b246d743 100644 --- a/functions-and-operators/group-by-modifier.md +++ b/functions-and-operators/group-by-modifier.md @@ -50,7 +50,7 @@ Before v8.3.0, TiDB only supports generating valid execution plans for the `WITH Starting from v8.3.0, the preceding limitation is removed. Regardless of whether the TiDB cluster contains TiFlash nodes, TiDB supports generating valid execution plans for the `WITH ROLLUP` syntax. -You can determine the storage engine that executes the `Expand` operator by checking the `task` attribute of the `Expand` operator in the execution plan. For more information, see [How to interpret the ROLLUP execution plan](#how-to-interpret-the-rollup-execution-plan). +You can determine the execution engine that executes the `Expand` operator by checking the `task` attribute of the `Expand` operator in the execution plan. For more information, see [How to interpret the ROLLUP execution plan](#how-to-interpret-the-rollup-execution-plan). ## Examples @@ -170,7 +170,7 @@ SELECT year, month, SUM(profit) AS profit, grouping(year) as grp_year, grouping( ## How to interpret the ROLLUP execution plan -To meet the requirements of multidimensional grouping, multidimensional data aggregation uses the `Expand` operator to replicate data. Each replica corresponds to a group at a specific dimension. With the data shuffling capability of MPP, the `Expand` operator can rapidly reorganize and calculate a large volume of data between multiple TiFlash nodes, fully utilizing the computational power of each node. +Multidimensional data aggregation uses the `Expand` operator to copy data to meet the needs of multidimensional grouping. Each copied data copy corresponds to a grouping of a specific dimension. Especially in MPP mode, the `Expand` operator can facilitate data shuffle to quickly reorganize and calculate a large amount of data between multiple nodes, making full use of the computing power of each node; while in TiDB mode, `Expand` Because the operator is only executed on a single TiDB node, data redundancy will expand according to the number of `Grouping Sets`. The implementation of the `Expand` operator is similar to that of the `Projection` operator. The difference is that `Expand` is a multi-level `Projection`, which contains multiple levels of projection operation expressions. For each row of the raw data, the `Projection` operator generates only one row in results, whereas the `Expand` operator generates multiple rows in results (the number of rows is equal to the number of levels in projection operation expressions). From 49899b8feac45a437651090fbfb340b0af76bb4f Mon Sep 17 00:00:00 2001 From: Arenatlx Date: Wed, 14 Aug 2024 11:04:49 +0800 Subject: [PATCH 5/7] Update functions-and-operators/group-by-modifier.md --- functions-and-operators/group-by-modifier.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions-and-operators/group-by-modifier.md b/functions-and-operators/group-by-modifier.md index f9cd0b246d743..d7bc8bffc623e 100644 --- a/functions-and-operators/group-by-modifier.md +++ b/functions-and-operators/group-by-modifier.md @@ -170,7 +170,7 @@ SELECT year, month, SUM(profit) AS profit, grouping(year) as grp_year, grouping( ## How to interpret the ROLLUP execution plan -Multidimensional data aggregation uses the `Expand` operator to copy data to meet the needs of multidimensional grouping. Each copied data copy corresponds to a grouping of a specific dimension. Especially in MPP mode, the `Expand` operator can facilitate data shuffle to quickly reorganize and calculate a large amount of data between multiple nodes, making full use of the computing power of each node; while in TiDB mode, `Expand` Because the operator is only executed on a single TiDB node, data redundancy will expand according to the number of `Grouping Sets`. +Multidimensional data aggregation uses the `Expand` operator to copy data to meet the needs of multidimensional grouping. Each copied data copy corresponds to a grouping of a specific dimension. In MPP mode, the `Expand` operator can facilitate data shuffle to quickly reorganize and calculate a large amount of data between multiple nodes, making full use of the computing power of each node; In a TiDB cluster that does not contain TiFlash nodes, because the `Expand` operator is only executed on a single TiDB node, data redundancy will increase as the number of dimension groupings (`grouping set`) increases. The implementation of the `Expand` operator is similar to that of the `Projection` operator. The difference is that `Expand` is a multi-level `Projection`, which contains multiple levels of projection operation expressions. For each row of the raw data, the `Projection` operator generates only one row in results, whereas the `Expand` operator generates multiple rows in results (the number of rows is equal to the number of levels in projection operation expressions). From 0d5879c48ac9cb81488babacfc88da19f06c989c Mon Sep 17 00:00:00 2001 From: Aolin Date: Wed, 14 Aug 2024 15:10:23 +0800 Subject: [PATCH 6/7] Apply suggestions from code review Co-authored-by: Grace Cai --- functions-and-operators/group-by-modifier.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/functions-and-operators/group-by-modifier.md b/functions-and-operators/group-by-modifier.md index d7bc8bffc623e..956d0ede3540b 100644 --- a/functions-and-operators/group-by-modifier.md +++ b/functions-and-operators/group-by-modifier.md @@ -42,15 +42,15 @@ Before v8.3.0, TiDB only supports generating valid execution plans for the `WITH - + -Before v8.3.0, TiDB only supports generating valid execution plans for the `WITH ROLLUP` syntax in [TiFlash MPP mode](/tiflash/use-tiflash-mpp-mode.md). Therefore, your TiDB cluster needs to contain TiFlash nodes, and the target table must be configured with the correct TiFlash replica. For more information, see [Scale out a TiFlash cluster](https://docs.pingcap.com/tidb/stable/scale-tidb-using-tiup#scale-out-a-tiflash-cluster). +Before v8.3.0, TiDB only supports generating valid execution plans for the `WITH ROLLUP` syntax in [TiFlash MPP mode](/tiflash/use-tiflash-mpp-mode.md). Therefore, your TiDB cluster needs to contain TiFlash nodes, and the target table must be configured with the correct TiFlash replica. For more information, see [Change node number](/tidb-cloud/scale-tidb-cluster.md#change-node-number). -Starting from v8.3.0, the preceding limitation is removed. Regardless of whether the TiDB cluster contains TiFlash nodes, TiDB supports generating valid execution plans for the `WITH ROLLUP` syntax. +Starting from v8.3.0, the preceding limitation is removed. Regardless of whether your TiDB cluster contains TiFlash nodes, TiDB supports generating valid execution plans for the `WITH ROLLUP` syntax. -You can determine the execution engine that executes the `Expand` operator by checking the `task` attribute of the `Expand` operator in the execution plan. For more information, see [How to interpret the ROLLUP execution plan](#how-to-interpret-the-rollup-execution-plan). +To identify whether TiDB or TiFlash executes the `Expand` operator, you can check the `task` attribute of the `Expand` operator in the execution plan. For more information, see [How to interpret the ROLLUP execution plan](#how-to-interpret-the-rollup-execution-plan). ## Examples @@ -170,11 +170,11 @@ SELECT year, month, SUM(profit) AS profit, grouping(year) as grp_year, grouping( ## How to interpret the ROLLUP execution plan -Multidimensional data aggregation uses the `Expand` operator to copy data to meet the needs of multidimensional grouping. Each copied data copy corresponds to a grouping of a specific dimension. In MPP mode, the `Expand` operator can facilitate data shuffle to quickly reorganize and calculate a large amount of data between multiple nodes, making full use of the computing power of each node; In a TiDB cluster that does not contain TiFlash nodes, because the `Expand` operator is only executed on a single TiDB node, data redundancy will increase as the number of dimension groupings (`grouping set`) increases. +Multidimensional data aggregation uses the `Expand` operator to copy data to meet the needs of multidimensional grouping. Each data copy corresponds to a grouping of a specific dimension. In MPP mode, the `Expand` operator can facilitate data shuffle to quickly reorganize and calculate a large amount of data between multiple nodes, making full use of the computing capacity of each node; In a TiDB cluster without TiFlash nodes, because the `Expand` operator is only executed on a single TiDB node, data redundancy will increase as the number of dimension groupings (`grouping set`) increases. The implementation of the `Expand` operator is similar to that of the `Projection` operator. The difference is that `Expand` is a multi-level `Projection`, which contains multiple levels of projection operation expressions. For each row of the raw data, the `Projection` operator generates only one row in results, whereas the `Expand` operator generates multiple rows in results (the number of rows is equal to the number of levels in projection operation expressions). -The following example shows the execution plan for a TiDB cluster that does not contain TiFlash nodes, where the `task` of the `Expand` operator is `root`, indicating that the `Expand` operator is executed in TiDB: +The following example shows the execution plan for a TiDB cluster without TiFlash nodes, where the `task` of the `Expand` operator is `root`, indicating that the `Expand` operator is executed in TiDB: ```sql EXPLAIN SELECT year, month, grouping(year), grouping(month), SUM(profit) AS profit FROM bank GROUP BY year, month WITH ROLLUP; From 93f83263c6b43ecf82c3d7520e8f34ddbab6cca9 Mon Sep 17 00:00:00 2001 From: Aolin Date: Mon, 19 Aug 2024 18:14:39 +0800 Subject: [PATCH 7/7] Apply suggestions from code review --- functions-and-operators/group-by-modifier.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions-and-operators/group-by-modifier.md b/functions-and-operators/group-by-modifier.md index 956d0ede3540b..bdc6a83d7c290 100644 --- a/functions-and-operators/group-by-modifier.md +++ b/functions-and-operators/group-by-modifier.md @@ -170,7 +170,7 @@ SELECT year, month, SUM(profit) AS profit, grouping(year) as grp_year, grouping( ## How to interpret the ROLLUP execution plan -Multidimensional data aggregation uses the `Expand` operator to copy data to meet the needs of multidimensional grouping. Each data copy corresponds to a grouping of a specific dimension. In MPP mode, the `Expand` operator can facilitate data shuffle to quickly reorganize and calculate a large amount of data between multiple nodes, making full use of the computing capacity of each node; In a TiDB cluster without TiFlash nodes, because the `Expand` operator is only executed on a single TiDB node, data redundancy will increase as the number of dimension groupings (`grouping set`) increases. +Multidimensional data aggregation uses the `Expand` operator to copy data to meet the needs of multidimensional grouping. Each data copy corresponds to a grouping of a specific dimension. In MPP mode, the `Expand` operator can facilitate data shuffle to quickly reorganize and calculate a large amount of data between multiple nodes, making full use of the computing capacity of each node. In a TiDB cluster without TiFlash nodes, because the `Expand` operator is only executed on a single TiDB node, data redundancy will increase as the number of dimension groupings (`grouping set`) increases. The implementation of the `Expand` operator is similar to that of the `Projection` operator. The difference is that `Expand` is a multi-level `Projection`, which contains multiple levels of projection operation expressions. For each row of the raw data, the `Projection` operator generates only one row in results, whereas the `Expand` operator generates multiple rows in results (the number of rows is equal to the number of levels in projection operation expressions).