Remove code

This commit is contained in:
Dmitry Novik 2023-05-22 15:43:30 +00:00
parent a4cb82127d
commit 70c1b1de57
11 changed files with 141 additions and 149 deletions

View File

@ -23,14 +23,6 @@ const ColumnIdentifier & GlobalPlannerContext::createColumnIdentifier(const Name
{
std::string column_identifier;
// if (column_source_node->hasAlias())
// column_identifier += column_source_node->getAlias();
// else if (const auto * table_source_node = column_source_node->as<TableNode>())
// column_identifier += table_source_node->getStorageID().getFullNameNotQuoted();
// if (!column_identifier.empty())
// column_identifier += '.';
column_identifier += column.name;
column_identifier += '_' + std::to_string(column_identifiers.size());

View File

@ -7,19 +7,19 @@ Partial sorting plan
Prefix sort description: n ASC
Result sort description: n ASC, x ASC
optimize_read_in_window_order=1, allow_experimental_analyzer=1
Prefix sort description: default.test_01655_plan_optimizations_optimize_read_in_window_order_n.n_0 ASC
Result sort description: default.test_01655_plan_optimizations_optimize_read_in_window_order_n.n_0 ASC, default.test_01655_plan_optimizations_optimize_read_in_window_order_n.x_1 ASC
Prefix sort description: n_0 ASC
Result sort description: n_0 ASC, x_1 ASC
No sorting plan
optimize_read_in_window_order=0
Sort description: n ASC, x ASC
optimize_read_in_window_order=0, allow_experimental_analyzer=1
Sort description: default.test_01655_plan_optimizations_optimize_read_in_window_order_n_x.n_0 ASC, default.test_01655_plan_optimizations_optimize_read_in_window_order_n_x.x_1 ASC
Sort description: n_0 ASC, x_1 ASC
optimize_read_in_window_order=1
Prefix sort description: n ASC, x ASC
Result sort description: n ASC, x ASC
optimize_read_in_window_order=1, allow_experimental_analyzer=1
Prefix sort description: default.test_01655_plan_optimizations_optimize_read_in_window_order_n_x.n_0 ASC, default.test_01655_plan_optimizations_optimize_read_in_window_order_n_x.x_1 ASC
Result sort description: default.test_01655_plan_optimizations_optimize_read_in_window_order_n_x.n_0 ASC, default.test_01655_plan_optimizations_optimize_read_in_window_order_n_x.x_1 ASC
Prefix sort description: n_0 ASC, x_1 ASC
Result sort description: n_0 ASC, x_1 ASC
Complex ORDER BY
optimize_read_in_window_order=0
3 3 1

View File

@ -30,7 +30,7 @@ Header: avgWeighted(x, y) Nullable(Float64)
255_UInt8 UInt8
1_UInt8 UInt8
Expression (Change column names to column identifiers)
Header: system.one.dummy_0 UInt8
Header: dummy_0 UInt8
ReadFromStorage (SystemOne)
Header: dummy UInt8
Expression (Conversion before UNION)
@ -46,7 +46,7 @@ Header: avgWeighted(x, y) Nullable(Float64)
NULL_Nullable(Nothing) Nullable(Nothing)
1_UInt8 UInt8
Expression (Change column names to column identifiers)
Header: system.one.dummy_0 UInt8
Header: dummy_0 UInt8
ReadFromStorage (SystemOne)
Header: dummy UInt8
SELECT avgWeighted(x, y) FROM (SELECT NULL, 255 AS x, 1 AS y UNION ALL SELECT y, NULL AS x, 1 AS y);

View File

@ -2,35 +2,35 @@ clickhouse-client --allow_experimental_analyzer=1 --query_kind secondary_query -
Expression ((Project names + Projection))
Header: dummy String
Aggregating
Header: toString(system.one.dummy_0) String
Header: toString(dummy_0) String
Expression ((Before GROUP BY + Change column names to column identifiers))
Header: toString(system.one.dummy_0) String
Header: toString(dummy_0) String
ReadFromStorage (SystemOne)
Header: dummy UInt8
clickhouse-local --allow_experimental_analyzer=1 --query_kind secondary_query -q explain plan header=1 select toString(dummy) as dummy from system.one group by dummy
Expression ((Project names + Projection))
Header: dummy String
Aggregating
Header: toString(system.one.dummy_0) String
Header: toString(dummy_0) String
Expression ((Before GROUP BY + Change column names to column identifiers))
Header: toString(system.one.dummy_0) String
Header: toString(dummy_0) String
ReadFromStorage (SystemOne)
Header: dummy UInt8
clickhouse-client --allow_experimental_analyzer=1 --query_kind initial_query -q explain plan header=1 select toString(dummy) as dummy from system.one group by dummy
Expression ((Project names + Projection))
Header: dummy String
Aggregating
Header: toString(system.one.dummy_0) String
Header: toString(dummy_0) String
Expression ((Before GROUP BY + Change column names to column identifiers))
Header: toString(system.one.dummy_0) String
Header: toString(dummy_0) String
ReadFromStorage (SystemOne)
Header: dummy UInt8
clickhouse-local --allow_experimental_analyzer=1 --query_kind initial_query -q explain plan header=1 select toString(dummy) as dummy from system.one group by dummy
Expression ((Project names + Projection))
Header: dummy String
Aggregating
Header: toString(system.one.dummy_0) String
Header: toString(dummy_0) String
Expression ((Before GROUP BY + Change column names to column identifiers))
Header: toString(system.one.dummy_0) String
Header: toString(dummy_0) String
ReadFromStorage (SystemOne)
Header: dummy UInt8

View File

@ -2,51 +2,51 @@ Expression
Header: key String
value String
Join
Header: s1.key_0 String
s2.value_1 String
Header: key_0 String
value_1 String
Expression
Header: s1.key_0 String
Header: key_0 String
ReadFromStorage
Header: dummy UInt8
Union
Header: s2.key_2 String
s2.value_1 String
Header: key_2 String
value_1 String
Expression
Header: s2.key_2 String
s2.value_1 String
Header: key_2 String
value_1 String
ReadFromStorage
Header: dummy UInt8
Expression
Header: s2.key_2 String
s2.value_1 String
Header: key_2 String
value_1 String
ReadFromStorage
Header: dummy UInt8
Expression
Header: key String
value String
Join
Header: s1.key_0 String
s2.key_2 String
s2.value_1 String
Header: key_0 String
key_2 String
value_1 String
Sorting
Header: s1.key_0 String
Header: key_0 String
Expression
Header: s1.key_0 String
Header: key_0 String
ReadFromStorage
Header: dummy UInt8
Sorting
Header: s2.key_2 String
s2.value_1 String
Header: key_2 String
value_1 String
Union
Header: s2.key_2 String
s2.value_1 String
Header: key_2 String
value_1 String
Expression
Header: s2.key_2 String
s2.value_1 String
Header: key_2 String
value_1 String
ReadFromStorage
Header: dummy UInt8
Expression
Header: s2.key_2 String
s2.value_1 String
Header: key_2 String
value_1 String
ReadFromStorage
Header: dummy UInt8

View File

@ -34,7 +34,7 @@ DROP TABLE t1;
SET allow_experimental_analyzer = 1;
SELECT count() > 3 FROM (EXPLAIN PIPELINE header = 1 SELECT * FROM system.numbers ORDER BY number DESC) WHERE explain LIKE '%Header: system.numbers.number__ UInt64%';
SELECT count() > 3 FROM (EXPLAIN PIPELINE header = 1 SELECT * FROM system.numbers ORDER BY number DESC) WHERE explain LIKE '%Header: number__ UInt64%';
SELECT count() > 0 FROM (EXPLAIN PLAN SELECT * FROM system.numbers ORDER BY number DESC) WHERE explain ILIKE '%Sort%';
SELECT count() > 0 FROM (EXPLAIN SELECT * FROM system.numbers ORDER BY number DESC) WHERE explain ILIKE '%Sort%';
SELECT count() > 0 FROM (EXPLAIN CURRENT TRANSACTION);

View File

@ -4,19 +4,19 @@
2022-09-09 12:00:00 0x
2022-09-09 12:00:00 1
2022-09-09 12:00:00 1x
Prefix sort description: toStartOfMinute(test.t_0) ASC
Result sort description: toStartOfMinute(test.t_0) ASC, test.c1_1 ASC
Prefix sort description: toStartOfMinute(test.t_0) ASC
Result sort description: toStartOfMinute(test.t_0) ASC
Prefix sort description: negate(test.a_0) ASC
Result sort description: negate(test.a_0) ASC
Prefix sort description: negate(test.a_0) ASC, negate(test.b_1) ASC
Result sort description: negate(test.a_0) ASC, negate(test.b_1) ASC
Prefix sort description: test.a_0 DESC, negate(test.b_1) ASC
Result sort description: test.a_0 DESC, negate(test.b_1) ASC
Prefix sort description: negate(test.a_0) ASC, test.b_1 DESC
Result sort description: negate(test.a_0) ASC, test.b_1 DESC
Prefix sort description: negate(test.a_0) ASC
Result sort description: negate(test.a_0) ASC, test.b_1 ASC
Prefix sort description: test.a_0 ASC
Result sort description: test.a_0 ASC, negate(test.b_1) ASC
Prefix sort description: toStartOfMinute(t_0) ASC
Result sort description: toStartOfMinute(t_0) ASC, c1_1 ASC
Prefix sort description: toStartOfMinute(t_0) ASC
Result sort description: toStartOfMinute(t_0) ASC
Prefix sort description: negate(a_0) ASC
Result sort description: negate(a_0) ASC
Prefix sort description: negate(a_0) ASC, negate(b_1) ASC
Result sort description: negate(a_0) ASC, negate(b_1) ASC
Prefix sort description: a_0 DESC, negate(b_1) ASC
Result sort description: a_0 DESC, negate(b_1) ASC
Prefix sort description: negate(a_0) ASC, b_1 DESC
Result sort description: negate(a_0) ASC, b_1 DESC
Prefix sort description: negate(a_0) ASC
Result sort description: negate(a_0) ASC, b_1 ASC
Prefix sort description: a_0 ASC
Result sort description: a_0 ASC, negate(b_1) ASC

View File

@ -6,5 +6,5 @@
Order: a ASC, c ASC
ReadFromMergeTree (default.tab)
Aggregating
Order: default.tab.a_0 ASC, default.tab.c_2 ASC
Order: a_0 ASC, c_2 ASC
ReadFromMergeTree (default.tab)

View File

@ -6,43 +6,43 @@ SELECT count() FROM a JOIN b ON b.b1 = a.a1 JOIN c ON c.c1 = b.b1 JOIN d ON d.d1
Expression ((Project names + Projection))
Header: count() UInt64
Aggregating
Header: default.a.a2_4 String
Header: a2_4 String
count() UInt64
Expression ((Before GROUP BY + DROP unused columns after JOIN))
Header: default.a.a2_4 String
Header: a2_4 String
Join (JOIN FillRightFirst)
Header: default.a.a2_4 String
default.c.c1_2 UInt64
Header: a2_4 String
c1_2 UInt64
Expression ((JOIN actions + DROP unused columns after JOIN))
Header: default.a.a2_4 String
default.c.c1_2 UInt64
Header: a2_4 String
c1_2 UInt64
Join (JOIN FillRightFirst)
Header: default.a.a2_4 String
default.b.b1_0 UInt64
default.c.c1_2 UInt64
Header: a2_4 String
b1_0 UInt64
c1_2 UInt64
Expression ((JOIN actions + DROP unused columns after JOIN))
Header: default.a.a2_4 String
default.b.b1_0 UInt64
Header: a2_4 String
b1_0 UInt64
Join (JOIN FillRightFirst)
Header: default.a.a1_1 UInt64
default.a.a2_4 String
default.b.b1_0 UInt64
Header: a1_1 UInt64
a2_4 String
b1_0 UInt64
Expression ((JOIN actions + Change column names to column identifiers))
Header: default.a.a1_1 UInt64
default.a.a2_4 String
Header: a1_1 UInt64
a2_4 String
ReadFromMemoryStorage
Header: a1 UInt64
a2 String
Expression ((JOIN actions + Change column names to column identifiers))
Header: default.b.b1_0 UInt64
Header: b1_0 UInt64
ReadFromMemoryStorage
Header: b1 UInt64
Expression ((JOIN actions + Change column names to column identifiers))
Header: default.c.c1_2 UInt64
Header: c1_2 UInt64
ReadFromMemoryStorage
Header: c1 UInt64
Expression ((JOIN actions + Change column names to column identifiers))
Header: default.d.d1_3 UInt64
Header: d1_3 UInt64
ReadFromMemoryStorage
Header: d1 UInt64
EXPLAIN PLAN header = 1
@ -52,38 +52,38 @@ Expression ((Project names + (Projection + DROP unused columns after JOIN)))
Header: a2 String
d2 String
Join (JOIN FillRightFirst)
Header: default.a.a2_0 String
default.a.k_2 UInt64
default.d.d2_1 String
Header: a2_0 String
k_2 UInt64
d2_1 String
Expression (DROP unused columns after JOIN)
Header: default.a.a2_0 String
default.a.k_2 UInt64
Header: a2_0 String
k_2 UInt64
Join (JOIN FillRightFirst)
Header: default.a.a2_0 String
default.a.k_2 UInt64
Header: a2_0 String
k_2 UInt64
Expression (DROP unused columns after JOIN)
Header: default.a.a2_0 String
default.a.k_2 UInt64
Header: a2_0 String
k_2 UInt64
Join (JOIN FillRightFirst)
Header: default.a.a2_0 String
default.a.k_2 UInt64
Header: a2_0 String
k_2 UInt64
Expression (Change column names to column identifiers)
Header: default.a.a2_0 String
default.a.k_2 UInt64
Header: a2_0 String
k_2 UInt64
ReadFromMemoryStorage
Header: a2 String
k UInt64
Expression (Change column names to column identifiers)
Header: default.b.k_3 UInt64
Header: k_3 UInt64
ReadFromMemoryStorage
Header: k UInt64
Expression (Change column names to column identifiers)
Header: default.c.k_4 UInt64
Header: k_4 UInt64
ReadFromMemoryStorage
Header: k UInt64
Expression (Change column names to column identifiers)
Header: default.d.d2_1 String
default.d.k_5 UInt64
Header: d2_1 String
k_5 UInt64
ReadFromMemoryStorage
Header: d2 String
k UInt64
@ -97,55 +97,55 @@ WHERE c.c2 != '' ORDER BY a.a2
Expression (Project names)
Header: bx String
Sorting (Sorting for ORDER BY)
Header: default.a.a2_6 String
b.bx_0 String
Header: a2_6 String
bx_0 String
Expression ((Before ORDER BY + (Projection + )))
Header: default.a.a2_6 String
b.bx_0 String
Header: a2_6 String
bx_0 String
Join (JOIN FillRightFirst)
Header: default.a.a2_6 String
b.bx_0 String
default.c.c2_5 String
default.c.c1_3 UInt64
Header: a2_6 String
bx_0 String
c2_5 String
c1_3 UInt64
Filter (( + (JOIN actions + DROP unused columns after JOIN)))
Header: default.a.a2_6 String
b.bx_0 String
default.c.c2_5 String
default.c.c1_3 UInt64
Header: a2_6 String
bx_0 String
c2_5 String
c1_3 UInt64
Join (JOIN FillRightFirst)
Header: default.a.a2_6 String
b.bx_0 String
b.b1_1 UInt64
default.c.c2_5 String
default.c.c1_3 UInt64
Header: a2_6 String
bx_0 String
b1_1 UInt64
c2_5 String
c1_3 UInt64
Expression ((JOIN actions + DROP unused columns after JOIN))
Header: default.a.a2_6 String
b.bx_0 String
b.b1_1 UInt64
Header: a2_6 String
bx_0 String
b1_1 UInt64
Join (JOIN FillRightFirst)
Header: default.a.a1_2 UInt64
default.a.a2_6 String
b.bx_0 String
b.b1_1 UInt64
Header: a1_2 UInt64
a2_6 String
bx_0 String
b1_1 UInt64
Expression ((JOIN actions + Change column names to column identifiers))
Header: default.a.a1_2 UInt64
default.a.a2_6 String
Header: a1_2 UInt64
a2_6 String
ReadFromMemoryStorage
Header: a1 UInt64
a2 String
Expression ((JOIN actions + (Change column names to column identifiers + (Project names + (Projection + Change column names to column identifiers)))))
Header: b.b1_1 UInt64
b.bx_0 String
Header: b1_1 UInt64
bx_0 String
ReadFromMemoryStorage
Header: b1 UInt64
b2 String
Expression ((JOIN actions + Change column names to column identifiers))
Header: default.c.c1_3 UInt64
default.c.c2_5 String
Header: c1_3 UInt64
c2_5 String
ReadFromMemoryStorage
Header: c1 UInt64
c2 String
Expression ((JOIN actions + (Change column names to column identifiers + (Project names + (Projection + Change column names to column identifiers)))))
Header: d.d1_4 UInt64
Header: d1_4 UInt64
ReadFromStorage (SystemNumbers)
Header: number UInt64

View File

@ -2,27 +2,27 @@ Expression ((Project names + (Projection + )))
Header: t1.id UInt64
t1.value String
t2.value String
Actions: INPUT : 0 -> t1.id_0 UInt64 : 0
INPUT : 1 -> t1.value_1 String : 1
INPUT : 2 -> t2.value_2 String : 2
ALIAS t1.id_0 :: 0 -> t1.id UInt64 : 3
ALIAS t1.value_1 :: 1 -> t1.value String : 0
ALIAS t2.value_2 :: 2 -> t2.value String : 1
Actions: INPUT : 0 -> id_0 UInt64 : 0
INPUT : 1 -> value_1 String : 1
INPUT : 2 -> value_2 String : 2
ALIAS id_0 :: 0 -> t1.id UInt64 : 3
ALIAS value_1 :: 1 -> t1.value String : 0
ALIAS value_2 :: 2 -> t2.value String : 1
Positions: 3 0 1
FilledJoin (Filled JOIN)
Header: t1.id_0 UInt64
t1.value_1 String
t2.value_2 String
Header: id_0 UInt64
value_1 String
value_2 String
Filter (( + (JOIN actions + Change column names to column identifiers)))
Header: t1.id_0 UInt64
t1.value_1 String
Filter column: equals(t1.id_0, 0_UInt8) (removed)
Header: id_0 UInt64
value_1 String
Filter column: equals(id_0, 0_UInt8) (removed)
Actions: INPUT : 0 -> id UInt64 : 0
INPUT : 1 -> value String : 1
COLUMN Const(UInt8) -> 0_UInt8 UInt8 : 2
ALIAS id :: 0 -> t1.id_0 UInt64 : 3
ALIAS value :: 1 -> t1.value_1 String : 0
FUNCTION equals(t1.id_0 : 3, 0_UInt8 :: 2) -> equals(t1.id_0, 0_UInt8) UInt8 : 1
ALIAS id :: 0 -> id_0 UInt64 : 3
ALIAS value :: 1 -> value_1 String : 0
FUNCTION equals(id_0 : 3, 0_UInt8 :: 2) -> equals(id_0, 0_UInt8) UInt8 : 1
Positions: 1 3 0
ReadFromMergeTree (default.test_table)
Header: id UInt64

View File

@ -29,10 +29,10 @@ Header: id UInt64
value String
Actions: INPUT : 0 -> id UInt64 : 0
INPUT : 1 -> value String : 1
ALIAS id :: 0 -> default.test_table.id_0 UInt64 : 2
ALIAS value :: 1 -> default.test_table.value_1 String : 0
ALIAS default.test_table.id_0 :: 2 -> id UInt64 : 1
ALIAS default.test_table.value_1 :: 0 -> value String : 2
ALIAS id :: 0 -> id_0 UInt64 : 2
ALIAS value :: 1 -> value_1 String : 0
ALIAS id_0 :: 2 -> id UInt64 : 1
ALIAS value_1 :: 0 -> value String : 2
Positions: 1 2
ReadFromMergeTree (default.test_table)
Header: id UInt64