[
https://issues.apache.org/jira/browse/CALCITE-4073?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17140810#comment-17140810
]
Haisheng Yuan commented on CALCITE-4073:
----------------------------------------
I would refrain from adding new config params, and I would refrain from adding
more normalizations.
Right now I can't create a rexnode with {{$2 > $1}}.
Let's step back, think about how those duplicated RexNode (but with different
form) is generated.
1. Human written
a > b and b < a
Maybe not that much?
2. Calcite generated
infer join predicates from star / cyclic / clique queries
We may infer duplicate predicates with $1 = $5, $5 = $2, $5 = $1, $1 = $2..
I think this is the most (if not all) cases where vlsi's changes make
performance improvement. Even if we only tackle this case, and process it
during or after deriving equivalence classes, remove normalizations for all the
other cases, I guess we might still be able to gain the same performance boost
without loosing much.
However, for the cases described in this JIRA, I don't see there is any strong
needs, for the moment.
> Add a new component RexNormalize for more effect rex nodes normalization
> ------------------------------------------------------------------------
>
> Key: CALCITE-4073
> URL: https://issues.apache.org/jira/browse/CALCITE-4073
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.24.0
> Reporter: Danny Chen
> Assignee: Danny Chen
> Priority: Major
> Fix For: 1.24.0
>
>
> Currently, we only have simple normalization such as:
> $2 = $1 => $1 = $2
> $2 > $1 => $1 < $2
> we can extend the logic to more like:
> - put the complex predicates behind, like OR(OR(udf($1), $2), $3) => OR($3,
> OR(udf($1), $2))
> - put the udf operand behind, like OR(udf($1), $2) => OR($2, udf($1))
> - put the local variables that appears more frequently in the front, which is
> more user-friendly to code generation because the variable can be cached and
> reused.
> Also note that, we should allows flexible configuration for switch this
> function on/off(not a system calcite property now) for downstream users and
> projects(because the normalization may have some performance trade-off).
--
This message was sent by Atlassian Jira
(v8.3.4#803005)