2022-12-08 12:31:46 +00:00
|
|
|
-- { echoOn }
|
|
|
|
|
|
|
|
SELECT value FROM (SELECT tupleElement(value, 'a') AS value FROM test_table);
|
|
|
|
0
|
|
|
|
EXPLAIN QUERY TREE SELECT value FROM (
|
|
|
|
SELECT tupleElement(value, 'a') AS value FROM test_table
|
|
|
|
);
|
|
|
|
QUERY id: 0
|
|
|
|
PROJECTION COLUMNS
|
|
|
|
value UInt64
|
|
|
|
PROJECTION
|
|
|
|
LIST id: 1, nodes: 1
|
|
|
|
COLUMN id: 2, column_name: value, result_type: UInt64, source_id: 3
|
|
|
|
JOIN TREE
|
2023-08-24 20:32:40 +00:00
|
|
|
QUERY id: 3, alias: __table1, is_subquery: 1
|
2022-12-08 12:31:46 +00:00
|
|
|
PROJECTION COLUMNS
|
|
|
|
value UInt64
|
|
|
|
PROJECTION
|
|
|
|
LIST id: 4, nodes: 1
|
|
|
|
FUNCTION id: 5, function_name: tupleElement, function_type: ordinary, result_type: UInt64
|
|
|
|
ARGUMENTS
|
|
|
|
LIST id: 6, nodes: 2
|
|
|
|
COLUMN id: 7, column_name: value, result_type: Tuple(a UInt64), source_id: 8
|
|
|
|
CONSTANT id: 9, constant_value: \'a\', constant_value_type: String
|
|
|
|
JOIN TREE
|
2023-08-24 20:32:40 +00:00
|
|
|
TABLE id: 8, alias: __table2, table_name: default.test_table
|
2022-12-08 12:31:46 +00:00
|
|
|
SELECT '--';
|
|
|
|
--
|
|
|
|
EXPLAIN QUERY TREE SELECT value FROM (
|
|
|
|
SELECT tupleElement(value, 'a') AS value FROM test_table
|
|
|
|
) SETTINGS optimize_functions_to_subcolumns = 1;
|
|
|
|
QUERY id: 0
|
|
|
|
PROJECTION COLUMNS
|
|
|
|
value UInt64
|
|
|
|
PROJECTION
|
|
|
|
LIST id: 1, nodes: 1
|
|
|
|
COLUMN id: 2, column_name: value, result_type: UInt64, source_id: 3
|
|
|
|
JOIN TREE
|
2023-08-24 20:32:40 +00:00
|
|
|
QUERY id: 3, alias: __table1, is_subquery: 1
|
2022-12-08 12:31:46 +00:00
|
|
|
PROJECTION COLUMNS
|
|
|
|
value UInt64
|
|
|
|
PROJECTION
|
|
|
|
LIST id: 4, nodes: 1
|
|
|
|
COLUMN id: 5, column_name: value.a, result_type: UInt64, source_id: 6
|
|
|
|
JOIN TREE
|
2023-08-24 20:32:40 +00:00
|
|
|
TABLE id: 6, alias: __table2, table_name: default.test_table
|
2023-01-18 16:51:42 +00:00
|
|
|
SETTINGS optimize_functions_to_subcolumns=1
|
2022-12-08 12:31:46 +00:00
|
|
|
SELECT '--';
|
|
|
|
--
|
|
|
|
EXPLAIN QUERY TREE SELECT value FROM (
|
|
|
|
SELECT tupleElement(value, 'a') AS value FROM test_table SETTINGS optimize_functions_to_subcolumns = 0
|
|
|
|
) SETTINGS optimize_functions_to_subcolumns = 1;
|
|
|
|
QUERY id: 0
|
|
|
|
PROJECTION COLUMNS
|
|
|
|
value UInt64
|
|
|
|
PROJECTION
|
|
|
|
LIST id: 1, nodes: 1
|
|
|
|
COLUMN id: 2, column_name: value, result_type: UInt64, source_id: 3
|
|
|
|
JOIN TREE
|
2023-08-24 20:32:40 +00:00
|
|
|
QUERY id: 3, alias: __table1, is_subquery: 1
|
2022-12-08 12:31:46 +00:00
|
|
|
PROJECTION COLUMNS
|
|
|
|
value UInt64
|
|
|
|
PROJECTION
|
|
|
|
LIST id: 4, nodes: 1
|
|
|
|
FUNCTION id: 5, function_name: tupleElement, function_type: ordinary, result_type: UInt64
|
|
|
|
ARGUMENTS
|
|
|
|
LIST id: 6, nodes: 2
|
|
|
|
COLUMN id: 7, column_name: value, result_type: Tuple(a UInt64), source_id: 8
|
|
|
|
CONSTANT id: 9, constant_value: \'a\', constant_value_type: String
|
|
|
|
JOIN TREE
|
2023-08-24 20:32:40 +00:00
|
|
|
TABLE id: 8, alias: __table2, table_name: default.test_table
|
2023-01-18 16:51:42 +00:00
|
|
|
SETTINGS optimize_functions_to_subcolumns=0
|
|
|
|
SETTINGS optimize_functions_to_subcolumns=1
|
2022-12-08 12:31:46 +00:00
|
|
|
SELECT '--';
|
|
|
|
--
|
|
|
|
EXPLAIN QUERY TREE SELECT value FROM (
|
|
|
|
SELECT tupleElement(value, 'a') AS value FROM test_table
|
|
|
|
) SETTINGS optimize_functions_to_subcolumns = 0;
|
|
|
|
QUERY id: 0
|
|
|
|
PROJECTION COLUMNS
|
|
|
|
value UInt64
|
|
|
|
PROJECTION
|
|
|
|
LIST id: 1, nodes: 1
|
|
|
|
COLUMN id: 2, column_name: value, result_type: UInt64, source_id: 3
|
|
|
|
JOIN TREE
|
2023-08-24 20:32:40 +00:00
|
|
|
QUERY id: 3, alias: __table1, is_subquery: 1
|
2022-12-08 12:31:46 +00:00
|
|
|
PROJECTION COLUMNS
|
|
|
|
value UInt64
|
|
|
|
PROJECTION
|
|
|
|
LIST id: 4, nodes: 1
|
|
|
|
FUNCTION id: 5, function_name: tupleElement, function_type: ordinary, result_type: UInt64
|
|
|
|
ARGUMENTS
|
|
|
|
LIST id: 6, nodes: 2
|
|
|
|
COLUMN id: 7, column_name: value, result_type: Tuple(a UInt64), source_id: 8
|
|
|
|
CONSTANT id: 9, constant_value: \'a\', constant_value_type: String
|
|
|
|
JOIN TREE
|
2023-08-24 20:32:40 +00:00
|
|
|
TABLE id: 8, alias: __table2, table_name: default.test_table
|
2023-01-18 16:51:42 +00:00
|
|
|
SETTINGS optimize_functions_to_subcolumns=0
|
2022-12-08 12:31:46 +00:00
|
|
|
SELECT '--';
|
|
|
|
--
|
|
|
|
EXPLAIN QUERY TREE SELECT value FROM (
|
|
|
|
SELECT tupleElement(value, 'a') AS value FROM test_table SETTINGS optimize_functions_to_subcolumns = 1
|
|
|
|
) SETTINGS optimize_functions_to_subcolumns = 0;
|
|
|
|
QUERY id: 0
|
|
|
|
PROJECTION COLUMNS
|
|
|
|
value UInt64
|
|
|
|
PROJECTION
|
|
|
|
LIST id: 1, nodes: 1
|
|
|
|
COLUMN id: 2, column_name: value, result_type: UInt64, source_id: 3
|
|
|
|
JOIN TREE
|
2023-08-24 20:32:40 +00:00
|
|
|
QUERY id: 3, alias: __table1, is_subquery: 1
|
2022-12-08 12:31:46 +00:00
|
|
|
PROJECTION COLUMNS
|
|
|
|
value UInt64
|
|
|
|
PROJECTION
|
|
|
|
LIST id: 4, nodes: 1
|
|
|
|
COLUMN id: 5, column_name: value.a, result_type: UInt64, source_id: 6
|
|
|
|
JOIN TREE
|
2023-08-24 20:32:40 +00:00
|
|
|
TABLE id: 6, alias: __table2, table_name: default.test_table
|
2023-01-18 16:51:42 +00:00
|
|
|
SETTINGS optimize_functions_to_subcolumns=1
|
|
|
|
SETTINGS optimize_functions_to_subcolumns=0
|