gianm commented on code in PR #15766:
URL: https://github.com/apache/druid/pull/15766#discussion_r1470569617


##########
sql/src/main/java/org/apache/druid/sql/calcite/filtration/CombineAndSimplifyBounds.java:
##########
@@ -270,6 +269,18 @@ private static DimFilter doSimplify(final List<DimFilter> 
children, boolean disj
             childrenToAdd.add(Ranges.toFilter(rangeRefKey, range));
           }
         }
+      } else {
+        if (disjunction && rangeSet.asRanges().size() == 2) {

Review Comment:
   Does this approach generate a good plan (two range filters and'ed together) 
if there are two `NOT BETWEEN`? Like,
   
   ```
   SELECT COUNT(*)
   FROM foo
   WHERE
     dim1 NOT BETWEEN 'a' AND 'c'
     AND dim1 NOT BETWEEN 'e' AND 'g'
   ```



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to