2021-02-26 16:29:56 +00:00
|
|
|
Too many optimizations applied to query plan
|
|
|
|
Too many optimizations applied to query plan
|
2021-02-12 11:31:14 +00:00
|
|
|
> sipHash should be calculated after filtration
|
2021-01-19 13:35:26 +00:00
|
|
|
FUNCTION sipHash64
|
|
|
|
Filter column: equals
|
2021-02-12 11:31:14 +00:00
|
|
|
> sorting steps should know about limit
|
2021-01-19 13:35:26 +00:00
|
|
|
Limit 10
|
2021-10-19 08:11:54 +00:00
|
|
|
Sorting
|
|
|
|
Sorting
|
2021-01-19 13:35:26 +00:00
|
|
|
Limit 10
|
2021-02-12 11:31:14 +00:00
|
|
|
-- filter push down --
|
|
|
|
> filter should be pushed down after aggregating
|
|
|
|
Aggregating
|
|
|
|
Filter
|
2021-02-17 16:54:37 +00:00
|
|
|
0 1
|
|
|
|
1 2
|
|
|
|
2 3
|
|
|
|
3 4
|
|
|
|
4 5
|
|
|
|
5 6
|
|
|
|
6 7
|
|
|
|
7 8
|
|
|
|
8 9
|
|
|
|
9 10
|
2021-02-12 11:31:14 +00:00
|
|
|
> filter should be pushed down after aggregating, column after aggregation is const
|
|
|
|
COLUMN Const(UInt8) -> notEquals(y, 0)
|
|
|
|
Aggregating
|
|
|
|
Filter
|
|
|
|
Filter
|
2021-02-17 16:54:37 +00:00
|
|
|
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
|
2021-02-12 11:31:14 +00:00
|
|
|
> 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)
|
2021-02-17 16:54:37 +00:00
|
|
|
0 1
|
|
|
|
1 2
|
|
|
|
2 3
|
|
|
|
3 4
|
|
|
|
5 6
|
|
|
|
6 7
|
|
|
|
7 8
|
|
|
|
8 9
|
|
|
|
9 10
|
2021-02-12 11:31:14 +00:00
|
|
|
> one condition of filter should be pushed down after aggregating, other condition is casted
|
|
|
|
Filter column
|
2021-08-07 11:31:53 +00:00
|
|
|
FUNCTION _CAST(minus(s, 4) :: 1, UInt8 :: 3) -> and(notEquals(y, 0), minus(s, 4))
|
2021-02-12 11:31:14 +00:00
|
|
|
Aggregating
|
|
|
|
Filter column: notEquals(y, 0)
|
2021-02-17 16:54:37 +00:00
|
|
|
0 1
|
|
|
|
1 2
|
|
|
|
2 3
|
|
|
|
3 4
|
|
|
|
5 6
|
|
|
|
6 7
|
|
|
|
7 8
|
|
|
|
8 9
|
|
|
|
9 10
|
2021-02-12 11:31:14 +00:00
|
|
|
> one condition of filter should be pushed down after aggregating, other two conditions are ANDed
|
|
|
|
Filter column
|
2021-02-20 17:42:06 +00:00
|
|
|
FUNCTION and(minus(s, 8) :: 1, minus(s, 4) :: 2) -> and(notEquals(y, 0), minus(s, 8), minus(s, 4))
|
2021-02-12 11:31:14 +00:00
|
|
|
Aggregating
|
|
|
|
Filter column: notEquals(y, 0)
|
2021-02-17 16:54:37 +00:00
|
|
|
0 1
|
|
|
|
1 2
|
|
|
|
2 3
|
|
|
|
3 4
|
|
|
|
5 6
|
|
|
|
6 7
|
|
|
|
7 8
|
|
|
|
9 10
|
2021-02-12 11:31:14 +00:00
|
|
|
> 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
|
2021-02-20 17:42:06 +00:00
|
|
|
Filter column: and(notEquals(y, 0), minus(y, 4))
|
2021-02-17 16:54:37 +00:00
|
|
|
0 1
|
|
|
|
1 2
|
|
|
|
2 3
|
|
|
|
4 5
|
|
|
|
5 6
|
|
|
|
6 7
|
|
|
|
7 8
|
|
|
|
9 10
|
2021-02-12 16:06:18 +00:00
|
|
|
> 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)
|
2021-02-17 16:54:37 +00:00
|
|
|
1 3
|
|
|
|
> filter is pushed down before Distinct
|
|
|
|
Distinct
|
|
|
|
Distinct
|
|
|
|
Filter column: notEquals(y, 2)
|
|
|
|
0 0
|
|
|
|
0 1
|
|
|
|
1 0
|
|
|
|
1 1
|
|
|
|
> filter is pushed down before sorting steps
|
2021-10-19 08:11:54 +00:00
|
|
|
Sorting
|
|
|
|
Sorting
|
2021-02-17 16:54:37 +00:00
|
|
|
Filter column: and(notEquals(x, 0), notEquals(y, 0))
|
|
|
|
1 2
|
|
|
|
1 1
|
2021-02-18 13:13:09 +00:00
|
|
|
> filter is pushed down before TOTALS HAVING and aggregating
|
|
|
|
TotalsHaving
|
|
|
|
Aggregating
|
|
|
|
Filter column: notEquals(y, 2)
|
|
|
|
0 12
|
|
|
|
1 15
|
|
|
|
3 10
|
|
|
|
|
|
|
|
0 37
|
2021-03-25 18:11:54 +00:00
|
|
|
> filter is pushed down before CreatingSets
|
|
|
|
CreatingSets
|
|
|
|
Filter
|
|
|
|
Filter
|
|
|
|
1
|
|
|
|
3
|
|
|
|
> one condition of filter is pushed down before LEFT JOIN
|
|
|
|
Join
|
|
|
|
Filter column: notEquals(number, 1)
|
|
|
|
Join
|
|
|
|
0 0
|
|
|
|
3 3
|
|
|
|
> one condition of filter is pushed down before INNER JOIN
|
|
|
|
Join
|
|
|
|
Filter column: notEquals(number, 1)
|
|
|
|
Join
|
|
|
|
3 3
|
|
|
|
> filter is pushed down before UNION
|
|
|
|
Union
|
|
|
|
Filter
|
|
|
|
Filter
|
|
|
|
2 3
|
|
|
|
2 3
|
2022-03-25 15:18:24 +00:00
|
|
|
> function calculation should be done after sorting and limit (if possible)
|
2022-03-25 16:20:29 +00:00
|
|
|
> Expression should be divided into two subexpressions and only one of them should be moved after Sorting
|
2022-04-25 18:23:24 +00:00
|
|
|
Expression ((Projection + Before ORDER BY [lifted up part]))
|
2022-03-29 19:16:05 +00:00
|
|
|
FUNCTION sipHash64
|
2022-03-25 15:18:24 +00:00
|
|
|
Sorting
|
2022-03-29 19:16:05 +00:00
|
|
|
Expression (Before ORDER BY)
|
|
|
|
FUNCTION plus
|
2022-03-29 10:55:48 +00:00
|
|
|
> this query should be executed without throwing an exception
|
|
|
|
0
|