mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-16 19:32:07 +00:00
44 lines
1.2 KiB
SQL
44 lines
1.2 KiB
SQL
SET allow_experimental_analyzer = 1;
|
|
SET optimize_functions_to_subcolumns = 0;
|
|
|
|
DROP TABLE IF EXISTS test_table;
|
|
CREATE TABLE test_table (id UInt64, value Tuple(a UInt64)) ENGINE=MergeTree ORDER BY id;
|
|
|
|
INSERT INTO test_table VALUES (0, tuple(0));
|
|
|
|
-- { echoOn }
|
|
|
|
SELECT value FROM (SELECT tupleElement(value, 'a') AS value FROM test_table);
|
|
|
|
EXPLAIN QUERY TREE SELECT value FROM (
|
|
SELECT tupleElement(value, 'a') AS value FROM test_table
|
|
);
|
|
|
|
SELECT '--';
|
|
|
|
EXPLAIN QUERY TREE SELECT value FROM (
|
|
SELECT tupleElement(value, 'a') AS value FROM test_table
|
|
) SETTINGS optimize_functions_to_subcolumns = 1;
|
|
|
|
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;
|
|
|
|
SELECT '--';
|
|
|
|
EXPLAIN QUERY TREE SELECT value FROM (
|
|
SELECT tupleElement(value, 'a') AS value FROM test_table
|
|
) SETTINGS optimize_functions_to_subcolumns = 0;
|
|
|
|
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;
|
|
|
|
-- { echoOff }
|
|
|
|
DROP TABLE test_table;
|