Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL: Extend the optimisations for equalities (#50792) #51098

Merged
merged 1 commit into from
Jan 16, 2020

Commits on Jan 16, 2020

  1. SQL: Extend the optimisations for equalities (elastic#50792)

    * Extend the optimizations for equalities
    
    This commit supplements the optimisations of equalities in conjunctions
    and disjunctions:
    * for conjunctions, the existing optimizations with ranges are extended
    with not-equalities and inequalities; these lead to a fast resolution,
    the conjunction either being evaluate to a FALSE, or the non-equality
    conditions being dropped as superfluous;
    * optimisations for disjunctions are added to be applied against ranges,
    inequalities and not-equalities; these lead to disjunction either
    becoming TRUE or the equality being dropped, either as superfluous or
    merged into a range/inequality.
    
    * Adress review notes
    
    * Fix the bug around wrongly optimizing 'a=2 OR a!=?', which only yields
    TRUE for same values in equality and inequality.
    * Var renamings, code style adjustments, comments corrections.
    
    * Address further review comments. Extend optim.
    
    - fix a few code comments;
    - extend the Equals OR NotEquals optimitsation (a=2 OR a!=5 -> a!=5);
    - extend the Equals OR Range optimisation on limits equality (a=2 OR
      2<=a<5 -> 2<=a<5);
    - in case an equality is being removed in a conjunction, the rest of
      possible optimisations to test is now skipped.
    
    * rename one var for better legiblity
    
    - s/rmEqual/removeEquals
    
    (cherry picked from commit 62e7c6a)
    bpintea committed Jan 16, 2020
    Configuration menu
    Copy the full SHA
    cd452ac View commit details
    Browse the repository at this point in the history