Conversation
| while (tryMergeExpressions(frame.node, frame.node->children.front())); | ||
|
|
||
| if (frame.node->children.size() == 1) | ||
| tryLiftUpArrayJoin(frame.node, frame.node->children.front(), nodes); |
There was a problem hiding this comment.
Currently, it's unclear to me why this tree traversal is correct. Mostly because of changes in tree during traverse:
we add children to the traverse stack, after that change children for some nodes and continue.
I'm sure that everything works well, but maybe we can clarify this a little bit?
There was a problem hiding this comment.
Stack contains info for every nodes in the path from tree root to the current node.
Every optimization changes only current node and it's children.
So, optimization does not change any node in stack (except maybe current).
Also, optimization may change query plan step, but not query plan node (only add a new one). So, node.children will be always valid.
Also, this code is not the best one. I will try to update it later.
src/Interpreters/ActionsDAG.cpp
Outdated
| { | ||
| auto & child_data = data[child]; | ||
|
|
||
| /// If children is not created, int may be from split part. |
tests/performance/split_filter.xml
Outdated
| @@ -0,0 +1,4 @@ | |||
| <test> | |||
| <query>select sum(x), sum(y) from (select sipHash64(number) as x, bitAnd(number, 1024) as y from numbers_mt(200000000)) where y = 0 settings enable_optimize_predicate_expression=0</query> | |||
There was a problem hiding this comment.
bitAnd(number, 1024) quite strange condition.
|
ANTLR failure should be investigated. |
select sumIf(NULL, (number % 2) > -9223372036854775808) from numbers(1)
SELECT today() - 65535, sumIf(1., (number % -1) > 1048575) FROM numbers(1048576)same stack
SELECT tuple(toDateTime(number) + 9223372036854775807) FROM numbers(1023) |
|
@KochetovNicolai This patches introduce one UAF: SELECT [NULL, '25.6', '-0.02', NULL], [NULL], 1024, [NULL, '10485.76', NULL, NULL], [NULL, '-922337203.6854775808', toNullable(NULL)], [NULL] FROM (SELECT [multiIf((number % 1023) = -inf, toString(number), NULL)], NULL, '-1', multiIf((number % NULL) NULL, toString(number), ''), [NULL, NULL], multiIf((number % NULL) = 65536, toString(number), '') AS s FROM system.numbers) LIMIT 1024 |
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Support splitting
Filterstep of query plan intoExpression + Filterpair. Together withExpression + Expressionmerging optimization (#17458) it may delay execution for some expressions afterFilterstep.Example:
Before (sipHash64 is calculated before Filter):
After (sipHash64 is calculated after Filter):