jinxing64 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_r340483666
##########
File path:
core/src/main/java/org/apache/calcite/rel/rules/ReduceExpressionsRule.java
##########
@@ -845,9 +846,12 @@ protected static RexNode substitute(RexCall call, int
ordinal, RexNode node) {
List<Boolean> addCasts) {
this.simplify = simplify;
this.unknownAs = unknownAs;
- this.reducibleExps = reducibleExps;
+ this.reducibleExpsMap = new HashMap<>();
this.reducedValues = reducedValues;
this.addCasts = addCasts;
+ for (int i = 0; i < reducibleExps.size(); i++) {
+ reducibleExpsMap.put(reducibleExps.get(i), i);
+ }
Review comment:
LGTM ~
should we also save `reducedValues` by map ? Thus to save memory
----------------------------------------------------------------
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