ClickHouse/tests/queries/0_stateless/01655_plan_optimizations.reference
2023-08-05 14:11:22 +03:00

212 lines
5.5 KiB
Plaintext

Too many optimizations applied to query plan
Too many optimizations applied to query plan
> sipHash should be calculated after filtration
FUNCTION sipHash64
Filter column: equals
> sorting steps should know about limit
Limit 10
Sorting
Sorting
Limit 10
-- filter push down --
> filter should be pushed down after aggregating
Aggregating
Filter
0 1
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
> filter should be pushed down after aggregating, column after aggregation is const
COLUMN Const(UInt8) -> notEquals(y, 0)
Aggregating
Filter
Filter
> (analyzer) filter should be pushed down after aggregating, column after aggregation is const
COLUMN Const(UInt8) -> notEquals(y_1, 0_UInt8)
Aggregating
Filter
Filter
0 1 1
1 2 1
2 3 1
3 4 1
4 5 1
5 6 1
6 7 1
7 8 1
8 9 1
9 10 1
> one condition of filter should be pushed down after aggregating, other condition is aliased
Filter column
ALIAS notEquals(s, 4) :: 1 -> and(notEquals(y, 0), notEquals(s, 4))
Aggregating
Filter column: notEquals(y, 0)
> (analyzer) one condition of filter should be pushed down after aggregating, other condition is aliased
Filter column
ALIAS notEquals(s_0, 4_UInt8) :: 0 -> and(notEquals(y_1, 0_UInt8), notEquals(s_0, 4_UInt8))
Aggregating
Filter column: notEquals(y_1, 0_UInt8)
0 1
1 2
2 3
3 4
5 6
6 7
7 8
8 9
9 10
> one condition of filter should be pushed down after aggregating, other condition is casted
Filter column
FUNCTION and(minus(s, 4) :: 1, 1 :: 3) -> and(notEquals(y, 0), minus(s, 4)) UInt8 : 2
Aggregating
Filter column: notEquals(y, 0)
> (analyzer) one condition of filter should be pushed down after aggregating, other condition is casted
Filter column
FUNCTION and(minus(s_0, 4_UInt8) :: 0, 1 :: 3) -> and(notEquals(y_1, 0_UInt8), minus(s_0, 4_UInt8)) UInt8 : 2
Aggregating
Filter column: notEquals(y_1, 0_UInt8)
0 1
1 2
2 3
3 4
5 6
6 7
7 8
8 9
9 10
> one condition of filter should be pushed down after aggregating, other two conditions are ANDed
Filter column
FUNCTION and(minus(s, 8) :: 1, minus(s, 4) :: 2) -> and(notEquals(y, 0), minus(s, 8), minus(s, 4))
Aggregating
Filter column: notEquals(y, 0)
> (analyzer) one condition of filter should be pushed down after aggregating, other two conditions are ANDed
Filter column
FUNCTION and(minus(s_0, 8_UInt8) :: 0, minus(s_0, 4_UInt8) :: 2) -> and(notEquals(y_1, 0_UInt8), minus(s_0, 8_UInt8), minus(s_0, 4_UInt8))
Aggregating
Filter column: notEquals(y_1, 0_UInt8)
0 1
1 2
2 3
3 4
5 6
6 7
7 8
9 10
> two conditions of filter should be pushed down after aggregating and ANDed, one condition is aliased
Filter column
ALIAS notEquals(s, 8) :: 1 -> and(notEquals(y, 0), notEquals(s, 8), minus(y, 4))
Aggregating
Filter column: and(notEquals(y, 0), minus(y, 4))
> (analyzer) two conditions of filter should be pushed down after aggregating and ANDed, one condition is aliased
Filter column
ALIAS notEquals(s_0, 8_UInt8) :: 0 -> and(notEquals(y_1, 0_UInt8), notEquals(s_0, 8_UInt8), minus(y_1, 4_UInt8))
Aggregating
Filter column: and(notEquals(y_1, 0_UInt8), minus(y_1, 4_UInt8))
0 1
1 2
2 3
4 5
5 6
6 7
7 8
9 10
> filter is split, one part is filtered before ARRAY JOIN
Filter column: and(notEquals(y, 2), notEquals(x, 0))
ARRAY JOIN x
Filter column: notEquals(y, 2)
> (analyzer) filter is split, one part is filtered before ARRAY JOIN
Filter column: and(notEquals(y_1, 2_UInt8), notEquals(x_0, 0_UInt8))
ARRAY JOIN x_0
Filter column: notEquals(y_1, 2_UInt8)
1 3
> filter is pushed down before Distinct
Distinct
Distinct
Filter column: notEquals(y, 2)
> (analyzer) filter is pushed down before Distinct
Distinct
Distinct
Filter column: notEquals(y_1, 2_UInt8)
0 0
0 1
1 0
1 1
> filter is pushed down before sorting steps
Sorting
Sorting
Filter column: and(notEquals(x, 0), notEquals(y, 0))
> (analyzer) filter is pushed down before sorting steps
Sorting
Sorting
Filter column: and(notEquals(x_0, 0_UInt8), notEquals(y_1, 0_UInt8))
1 2
1 1
> filter is pushed down before TOTALS HAVING and aggregating
TotalsHaving
Aggregating
Filter column: notEquals(y, 2)
> (analyzer) filter is pushed down before TOTALS HAVING and aggregating
TotalsHaving
Aggregating
Filter column: notEquals(y_0, 2_UInt8)
0 12
1 15
3 10
0 37
> filter is pushed down before CreatingSets
CreatingSets
Filter
Filter
1
3
> one condition of filter is pushed down before LEFT JOIN
Join
Join
Filter column: notEquals(number, 1)
Join
> (analyzer) one condition of filter is pushed down before LEFT JOIN
Join
Join
Filter column: notEquals(number_0, 1_UInt8)
0 0
3 3
> one condition of filter is pushed down before INNER JOIN
Join
Join
Filter column: notEquals(number, 1)
Join
> (analyzer) one condition of filter is pushed down before INNER JOIN
Join
Join
Filter column: notEquals(number_0, 1_UInt8)
3 3
> filter is pushed down before UNION
Union
Filter
Filter
2 3
2 3
> function calculation should be done after sorting and limit (if possible)
> Expression should be divided into two subexpressions and only one of them should be moved after Sorting
Expression ((Projection + Before ORDER BY [lifted up part]))
FUNCTION sipHash64
Sorting
Expression (Before ORDER BY)
FUNCTION plus
> (analyzer) function calculation should be done after sorting and limit (if possible)
> Expression should be divided into two subexpressions and only one of them should be moved after Sorting
Expression ((Project names + (Before ORDER BY + (Projection + Change column names to column identifiers)) [lifted up part]))
FUNCTION sipHash64
Sorting
Expression ((Before ORDER BY + (Projection + Change column names to column identifiers)))
FUNCTION plus
> this query should be executed without throwing an exception
0