neilconway opened a new issue, #22342:
URL: https://github.com/apache/datafusion/issues/22342

   ### Is your feature request related to a problem or challenge?
   
   `BinaryExpr` already implements row-level short-circuit for `AND` via 
`ShortCircuitStrategy::PreSelection` (#15462): when the LHS of an AND is mostly 
false (≤20% true), the RHS evaluates only on the rows that survived LHS, not on 
the full batch.
   
   The dual case for `OR` is not implemented. Today, OR only short-circuits 
when LHS is entirely true (`ReturnLeft`) or entirely false (`ReturnRight` — 
#15636). For partially-true LHS, the RHS still evaluates on the full batch, 
even though the rows where LHS is already true can never have their `OR` result 
change.
   
   This leaves a symmetric optimization on the table: when LHS of an OR is 
mostly true on a batch, RHS only needs to evaluate on the rows where LHS was 
false.
   
   ### Describe the solution you'd like
   
   _No response_
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### Additional context
   
   _No response_


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