Skip to content

Consider PreSelection short-circuit strategy for OR #22342

Description

@neilconway

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

Activity

  1. self-assigned this
    on Jun 16, 2026
  2. added a commit that references this issue on Jul 24, 2026
    e9a75bf
  3. added a commit that references this issue on Aug 12, 2026
    4106945
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions