xndai commented on a change in pull request #1547: [CALCITE-3460] Poor
performance in RexReplacer for large queries
URL: https://github.com/apache/calcite/pull/1547#discussion_r340730583
##########
File path:
core/src/main/java/org/apache/calcite/rel/rules/ReduceExpressionsRule.java
##########
@@ -868,8 +872,8 @@ protected static RexNode substitute(RexCall call, int
ordinal, RexNode node) {
}
private RexNode visit(final RexNode call) {
- int i = reducibleExps.indexOf(call);
- if (i == -1) {
+ Integer i = reducibleExpsMap.get(call);
+ if (i == null) {
return null;
}
RexNode replacement = reducedValues.get(i);
Review comment:
Depending on the implementation of List, reducedValues.get(i) and
addCasts.get(i) can be O(n) complexity as well. Right now we are using
ArrayList, which is fine. But could be a problem potentially in the future.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services