diff --git a/docs/en/operations/settings/settings.md b/docs/en/operations/settings/settings.md
index 5ed40b03705..93afb5a8fa3 100644
--- a/docs/en/operations/settings/settings.md
+++ b/docs/en/operations/settings/settings.md
@@ -3306,7 +3306,7 @@ Result:
└─────┘
```
-## optimize_syntax_fuse_aggregate {#optimize_syntax_fuse_aggregate}
+## optimize_syntax_fuse_functions {#optimize_syntax_fuse_functions}
Enables to fuse aggregate functions with identical argument. It rewrites query contains at least two aggregate functions from [sum](../../sql-reference/aggregate-functions/reference/sum.md#agg_function-sum), [count](../../sql-reference/aggregate-functions/reference/count.md#agg_function-count) or [avg](../../sql-reference/aggregate-functions/reference/avg.md#agg_function-avg) with identical argument to [sumCount](../../sql-reference/aggregate-functions/reference/sumcount.md#agg_function-sumCount).
@@ -3323,7 +3323,7 @@ Query:
``` sql
CREATE TABLE fuse_tbl(a Int8, b Int8) Engine = Log;
-SET optimize_syntax_fuse_aggregate = 1;
+SET optimize_syntax_fuse_functions = 1;
EXPLAIN SYNTAX SELECT sum(a), sum(b), count(b), avg(b) from fuse_tbl FORMAT TSV;
```
diff --git a/docs/en/sql-reference/aggregate-functions/reference/sumcount.md b/docs/en/sql-reference/aggregate-functions/reference/sumcount.md
index 417554084b2..00a7a9fc9f1 100644
--- a/docs/en/sql-reference/aggregate-functions/reference/sumcount.md
+++ b/docs/en/sql-reference/aggregate-functions/reference/sumcount.md
@@ -43,4 +43,4 @@ Result:
**See also**
-- [optimize_syntax_fuse_aggregate](../../../operations/settings/settings.md#optimize_syntax_fuse_aggregate) setting.
+- [optimize_syntax_fuse_functions](../../../operations/settings/settings.md#optimize_syntax_fuse_functions) setting.
diff --git a/docs/ru/operations/settings/settings.md b/docs/ru/operations/settings/settings.md
index a0b81121624..82a4b0bc1cd 100644
--- a/docs/ru/operations/settings/settings.md
+++ b/docs/ru/operations/settings/settings.md
@@ -3122,7 +3122,7 @@ SELECT * FROM test LIMIT 10 OFFSET 100;
Значение по умолчанию: `1800`.
-## optimize_syntax_fuse_aggregate {#optimize_syntax_fuse_aggregate}
+## optimize_syntax_fuse_functions {#optimize_syntax_fuse_functions}
Позволяет объединить агрегатные функции с одинаковым аргументом. Запрос, содержащий по крайней мере две агрегатные функции: [sum](../../sql-reference/aggregate-functions/reference/sum.md#agg_function-sum), [count](../../sql-reference/aggregate-functions/reference/count.md#agg_function-count) или [avg](../../sql-reference/aggregate-functions/reference/avg.md#agg_function-avg) с одинаковым аргументом, перезаписывается как [sumCount](../../sql-reference/aggregate-functions/reference/sumcount.md#agg_function-sumCount).
@@ -3139,7 +3139,7 @@ SELECT * FROM test LIMIT 10 OFFSET 100;
``` sql
CREATE TABLE fuse_tbl(a Int8, b Int8) Engine = Log;
-SET optimize_syntax_fuse_aggregate = 1;
+SET optimize_syntax_fuse_functions = 1;
EXPLAIN SYNTAX SELECT sum(a), sum(b), count(b), avg(b) from fuse_tbl FORMAT TSV;
```
@@ -3333,7 +3333,7 @@ SETTINGS index_granularity = 8192 │
## force_optimize_projection {#force-optimize-projection}
-Включает или отключает обязательное использование [проекций](../../engines/table-engines/mergetree-family/mergetree.md#projections) в запросах `SELECT`, если поддержка проекций включена (см. настройку [allow_experimental_projection_optimization](#allow-experimental-projection-optimization)).
+Включает или отключает обязательное использование [проекций](../../engines/table-engines/mergetree-family/mergetree.md#projections) в запросах `SELECT`, если поддержка проекций включена (см. настройку [allow_experimental_projection_optimization](#allow-experimental-projection-optimization)).
Возможные значения:
diff --git a/docs/ru/sql-reference/aggregate-functions/reference/sumcount.md b/docs/ru/sql-reference/aggregate-functions/reference/sumcount.md
index 5cab33ace6d..ac721577a9a 100644
--- a/docs/ru/sql-reference/aggregate-functions/reference/sumcount.md
+++ b/docs/ru/sql-reference/aggregate-functions/reference/sumcount.md
@@ -43,4 +43,4 @@ SELECT sumCount(x) from s_table;
**Смотрите также**
-- Настройка [optimize_syntax_fuse_aggregate](../../../operations/settings/settings.md#optimize_syntax_fuse_aggregate)
+- Настройка [optimize_syntax_fuse_functions](../../../operations/settings/settings.md#optimize_syntax_fuse_functions)
diff --git a/src/Core/Settings.h b/src/Core/Settings.h
index 2c1ab0d26c2..bb71273ae25 100644
--- a/src/Core/Settings.h
+++ b/src/Core/Settings.h
@@ -455,7 +455,7 @@ class IColumn;
M(Bool, allow_non_metadata_alters, true, "Allow to execute alters which affects not only tables metadata, but also data on disk", 0) \
M(Bool, enable_global_with_statement, true, "Propagate WITH statements to UNION queries and all subqueries", 0) \
M(Bool, aggregate_functions_null_for_empty, false, "Rewrite all aggregate functions in a query, adding -OrNull suffix to them", 0) \
- M(Bool, optimize_syntax_fuse_aggregate, false, "Fuse aggregate functions (`sum, avg, count` with identical arguments into one `sumCount`, quantile-family functions with the same argument into `quantiles*(...)[...]`)", 0) \
+ M(Bool, optimize_syntax_fuse_functions, false, "Fuse aggregate functions (`sum, avg, count` with identical arguments into one `sumCount`, quantile-family functions with the same argument into `quantiles*(...)[...]`)", 0) \
M(Bool, flatten_nested, true, "If true, columns of type Nested will be flatten to separate array columns instead of one array of tuples", 0) \
M(Bool, asterisk_include_materialized_columns, false, "Include MATERIALIZED columns for wildcard query", 0) \
M(Bool, asterisk_include_alias_columns, false, "Include ALIAS columns for wildcard query", 0) \
@@ -521,7 +521,7 @@ class IColumn;
M(HandleKafkaErrorMode, handle_kafka_error_mode, HandleKafkaErrorMode::DEFAULT, "Obsolete setting, does nothing.", 0) \
M(Bool, database_replicated_ddl_output, true, "Obsolete setting, does nothing.", 0) \
M(UInt64, replication_alter_columns_timeout, 60, "Obsolete setting, does nothing.", 0) \
- M(Bool, optimize_fuse_sum_count_avg, false, "Obsolete, use optimize_syntax_fuse_aggregate", 0) \
+ M(Bool, optimize_fuse_sum_count_avg, false, "Obsolete, use optimize_syntax_fuse_functions", 0) \
/** The section above is for obsolete settings. Do not add anything there. */
diff --git a/src/Interpreters/TreeOptimizer.cpp b/src/Interpreters/TreeOptimizer.cpp
index 38d8bdd081a..2cee9fe356f 100644
--- a/src/Interpreters/TreeOptimizer.cpp
+++ b/src/Interpreters/TreeOptimizer.cpp
@@ -776,7 +776,7 @@ void TreeOptimizer::apply(ASTPtr & query, TreeRewriterResult & result,
/// Remove duplicated columns from USING(...).
optimizeUsing(select_query);
- if (settings.optimize_syntax_fuse_aggregate)
+ if (settings.optimize_syntax_fuse_functions)
optimizeFuseQuantileFunctions(query);
}
diff --git a/src/Interpreters/TreeRewriter.cpp b/src/Interpreters/TreeRewriter.cpp
index bdeb00490c3..96dc6522b73 100644
--- a/src/Interpreters/TreeRewriter.cpp
+++ b/src/Interpreters/TreeRewriter.cpp
@@ -1068,7 +1068,7 @@ void TreeRewriter::normalize(
// if we have at least two different functions. E.g. we will replace sum(x)
// and count(x) with sumCount(x).1 and sumCount(x).2, and sumCount() will
// be calculated only once because of CSE.
- if (settings.optimize_fuse_sum_count_avg || settings.optimize_syntax_fuse_aggregate)
+ if (settings.optimize_fuse_sum_count_avg || settings.optimize_syntax_fuse_functions)
{
FuseSumCountAggregatesVisitor::Data data;
FuseSumCountAggregatesVisitor(data).visit(query);
diff --git a/tests/performance/fuse_sumcount.xml b/tests/performance/fuse_sumcount.xml
index 05e715868ea..237edb1b970 100644
--- a/tests/performance/fuse_sumcount.xml
+++ b/tests/performance/fuse_sumcount.xml
@@ -6,7 +6,7 @@
Also test GROUP BY with and without keys, because they might have different
optimizations. -->
- 1
+ 1
@@ -21,13 +21,13 @@
SELECT sum(number) FROM numbers(1000000000) FORMAT Null
SELECT sum(number), count(number) FROM numbers(1000000000) FORMAT Null
- SELECT sum(number), count(number) FROM numbers(1000000000) SETTINGS optimize_syntax_fuse_aggregate = 0 FORMAT Null
+ SELECT sum(number), count(number) FROM numbers(1000000000) SETTINGS optimize_syntax_fuse_functions = 0 FORMAT Null
SELECT sum(number), avg(number), count(number) FROM numbers(1000000000) FORMAT Null
- SELECT sum(number), avg(number), count(number) FROM numbers(1000000000) SETTINGS optimize_syntax_fuse_aggregate = 0 FORMAT Null
+ SELECT sum(number), avg(number), count(number) FROM numbers(1000000000) SETTINGS optimize_syntax_fuse_functions = 0 FORMAT Null
SELECT sum(number) FROM numbers(100000000) GROUP BY intHash32(number) % 1000 FORMAT Null
SELECT sum(number), count(number) FROM numbers(100000000) GROUP BY intHash32(number) % 1000 FORMAT Null
- SELECT sum(number), count(number) FROM numbers(100000000) GROUP BY intHash32(number) % 1000 SETTINGS optimize_syntax_fuse_aggregate = 0 FORMAT Null
+ SELECT sum(number), count(number) FROM numbers(100000000) GROUP BY intHash32(number) % 1000 SETTINGS optimize_syntax_fuse_functions = 0 FORMAT Null
SELECT sum(number), avg(number), count(number) FROM numbers(100000000) GROUP BY intHash32(number) % 1000 FORMAT Null
- SELECT sum(number), avg(number), count(number) FROM numbers(100000000) GROUP BY intHash32(number) % 1000 SETTINGS optimize_syntax_fuse_aggregate = 0 FORMAT Null
+ SELECT sum(number), avg(number), count(number) FROM numbers(100000000) GROUP BY intHash32(number) % 1000 SETTINGS optimize_syntax_fuse_functions = 0 FORMAT Null
diff --git a/tests/queries/0_stateless/01744_fuse_sum_count_aggregate.sql b/tests/queries/0_stateless/01744_fuse_sum_count_aggregate.sql
index 3cb54e074aa..4648889ca27 100644
--- a/tests/queries/0_stateless/01744_fuse_sum_count_aggregate.sql
+++ b/tests/queries/0_stateless/01744_fuse_sum_count_aggregate.sql
@@ -2,7 +2,7 @@ DROP TABLE IF EXISTS fuse_tbl;
CREATE TABLE fuse_tbl(a Int8, b Int8) Engine = Log;
INSERT INTO fuse_tbl SELECT number, number + 1 FROM numbers(1, 20);
-SET optimize_syntax_fuse_aggregate = 1;
+SET optimize_syntax_fuse_functions = 1;
SELECT sum(a), sum(b), count(b) from fuse_tbl;
EXPLAIN SYNTAX SELECT sum(a), sum(b), count(b) from fuse_tbl;
SELECT '---------NOT trigger fuse--------';
diff --git a/tests/queries/0_stateless/01956_fuse_quantile_optimization.sql b/tests/queries/0_stateless/01956_fuse_quantile_optimization.sql
index 197ef8a2cda..304aa803bcc 100644
--- a/tests/queries/0_stateless/01956_fuse_quantile_optimization.sql
+++ b/tests/queries/0_stateless/01956_fuse_quantile_optimization.sql
@@ -14,7 +14,7 @@ SELECT quantileBFloat16(0.2)(d), quantileBFloat16(0.3)(d), quantileBFloat16(0.4)
SELECT '---------After fuse result-----------';
-SET optimize_syntax_fuse_aggregate = true;
+SET optimize_syntax_fuse_functions = true;
SELECT 'quantile:';
EXPLAIN SYNTAX SELECT quantile(0.2)(d), quantile(0.3)(d) FROM datetime;
SELECT quantile(0.2)(d), quantile(0.3)(d) FROM datetime;