Skip to content

Conversation

@bpintea
Copy link
Contributor

@bpintea bpintea commented Jan 13, 2020

  • SQL: Optimisation fixes for conjunction merges

This commit fixes the following issues around the way comparisions are
merged with ranges in conjunctions:

  • the decision to include the equality of the lower limit is corrected;
  • the selection of the upper limit is corrected to use the upper bound
    of the range;
  • the list of terms in the conjunction is sorted to have the ranges at
    the bottom; this allows subsequent binary comarisions to find compatible
    ranges and potentially be merged away. The end guarantee being that the
    optimisation takes place irrespective of the order of the conjunction
    terms in the statement.

Some comments are also corrected.

  • adress review observation on anon. comparator

Replace anonymous comparator of split AND Expressions with a lambda.

(cherry picked from commit 9828cb1)

* SQL: Optimisation fixes for conjunction merges

This commit fixes the following issues around the way comparisions are
merged with ranges in conjunctions:
* the decision to include the equality of the lower limit is corrected;
* the selection of the upper limit is corrected to use the upper bound
of the range;
* the list of terms in the conjunction is sorted to have the ranges at
the bottom; this allows subsequent binary comarisions to find compatible
ranges and potentially be merged away. The end guarantee being that the
optimisation takes place irrespective of the order of the conjunction
terms in the statement.

Some comments are also corrected.

* adress review observation on anon. comparator

Replace anonymous comparator of split AND Expressions with a lambda.

(cherry picked from commit 9828cb1)
@bpintea bpintea merged commit bf6f4fe into elastic:7.5 Jan 13, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/SQL)

@bpintea bpintea deleted the port/7.5_50703 branch January 13, 2020 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants