danny0405 commented on a change in pull request #2238:
URL: https://github.com/apache/calcite/pull/2238#discussion_r516407768



##########
File path: core/src/main/java/org/apache/calcite/rex/RexSimplify.java
##########
@@ -1330,7 +1330,7 @@ RexNode simplifyAnd(RexCall e, RexUnknownAs unknownAs) {
 
     final SargCollector sargCollector = new SargCollector(rexBuilder, true);
     operands.forEach(t -> sargCollector.accept(t, terms));
-    if (sargCollector.map.values().stream().anyMatch(b -> b.complexity() > 1)) 
{
+    if (sargCollector.needToFix(terms.size())) {

Review comment:
       The `drawback` is there are many unnecessary plan change.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to