richardstartin commented on a change in pull request #8411:
URL: https://github.com/apache/pinot/pull/8411#discussion_r837782397



##########
File path: 
pinot-core/src/main/java/org/apache/pinot/core/operator/filter/OrFilterOperator.java
##########
@@ -60,4 +64,37 @@ public String toExplainString() {
   public List<Operator> getChildOperators() {
     return new ArrayList<>(_filterOperators);
   }
+
+  @Override
+  public boolean canOptimizeCount() {
+    boolean allChildrenProduceBitmaps = true;
+    for (BaseFilterOperator child : _filterOperators) {
+      allChildrenProduceBitmaps &= child.canProduceBitmaps();
+      _anyChildrenMatchAll |= child.isResultMatchingAll();
+    }
+    return _anyChildrenMatchAll | allChildrenProduceBitmaps;
+  }
+
+  @Override
+  public int getNumMatchingDocs() {
+    if (_anyChildrenMatchAll) {
+      return _numDocs;
+    }
+    List<BitmapCollection> children = new ArrayList<>(_filterOperators.size());
+    for (BaseFilterOperator child : _filterOperators) {
+      children.add(child.getBitmaps());
+    }
+    switch (children.size()) {
+      case 1:
+        return children.get(0).cardinality();

Review comment:
       At present...




-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to