ClickHouse/tests/queries/0_stateless/02481_analyzer_optimize_aggregation_arithmetics.reference
2023-01-18 00:30:30 +00:00

65 lines
2.6 KiB
Plaintext

-- { echoOn }
EXPLAIN QUERY TREE SELECT avg(log(2) * number) FROM numbers(10);
QUERY id: 0
PROJECTION COLUMNS
avg(multiply(log(2), number)) Float64
PROJECTION
LIST id: 1, nodes: 1
FUNCTION id: 2, function_name: multiply, function_type: ordinary, result_type: Float64
ARGUMENTS
LIST id: 3, nodes: 2
CONSTANT id: 4, constant_value: Float64_0.6931471805599453, constant_value_type: Float64
EXPRESSION
FUNCTION id: 5, function_name: log, function_type: ordinary, result_type: Float64
ARGUMENTS
LIST id: 6, nodes: 1
CONSTANT id: 7, constant_value: UInt64_2, constant_value_type: UInt8
FUNCTION id: 8, function_name: avg, function_type: aggregate, result_type: Float64
ARGUMENTS
LIST id: 9, nodes: 1
COLUMN id: 10, column_name: number, result_type: UInt64, source_id: 11
JOIN TREE
TABLE_FUNCTION id: 11, table_function_name: numbers
ARGUMENTS
LIST id: 12, nodes: 1
CONSTANT id: 13, constant_value: UInt64_10, constant_value_type: UInt8
EXPLAIN QUERY TREE SELECT avg(number * log(2)) FROM numbers(10);
QUERY id: 0
PROJECTION COLUMNS
avg(multiply(number, log(2))) Float64
PROJECTION
LIST id: 1, nodes: 1
FUNCTION id: 2, function_name: multiply, function_type: ordinary, result_type: Float64
ARGUMENTS
LIST id: 3, nodes: 2
FUNCTION id: 4, function_name: avg, function_type: aggregate, result_type: Float64
ARGUMENTS
LIST id: 5, nodes: 1
COLUMN id: 6, column_name: number, result_type: UInt64, source_id: 7
CONSTANT id: 8, constant_value: Float64_0.6931471805599453, constant_value_type: Float64
EXPRESSION
FUNCTION id: 9, function_name: log, function_type: ordinary, result_type: Float64
ARGUMENTS
LIST id: 10, nodes: 1
CONSTANT id: 11, constant_value: UInt64_2, constant_value_type: UInt8
JOIN TREE
TABLE_FUNCTION id: 7, table_function_name: numbers
ARGUMENTS
LIST id: 12, nodes: 1
CONSTANT id: 13, constant_value: UInt64_10, constant_value_type: UInt8
SELECT round(avg(log(2) * number), 6) AS k FROM numbers(10000000) GROUP BY number % 3, number % 2;
3465734.516505
3465735.209653
3465735.9028
3465736.595947
3465735.209653
3465735.9028
SELECT round(avg(number * log(2)), 6) AS k FROM numbers(10000000) GROUP BY number % 3, number % 2;
3465734.516505
3465735.209653
3465735.9028
3465736.595947
3465735.209653
3465735.9028