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: Improve optimization of binary comparisons and equal #49637

Closed
costin opened this issue Nov 27, 2019 · 5 comments
Closed

SQL: Improve optimization of binary comparisons and equal #49637

costin opened this issue Nov 27, 2019 · 5 comments
Assignees

Comments

@costin
Copy link
Member

costin commented Nov 27, 2019

Teach optimizer to handle equality and a comparison:

a = 2 AND a > 1 -> a=2 but also
a = 2 AND a > 3 -> FALSE

@elasticmachine
Copy link
Collaborator

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

@costin
Copy link
Member Author

costin commented Nov 27, 2019

Also inequality - a != 2 AND a >3 -> a > 3

@matriv
Copy link
Contributor

matriv commented Nov 27, 2019

++
Would be a nice optimization to prevent unnecessary clauses from leading to scripting queries and decreasing performance.

@olegbonar
Copy link
Contributor

olegbonar commented Dec 5, 2019

Hi @costin! If I got it right this optimization is to implement another static class in org.elasticsearch.xpack.sql.optimizer.Optimizer. Any ideas on how to hack it?

@bpintea
Copy link
Contributor

bpintea commented Feb 3, 2020

Fixed in #50703, #50792, #51088.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants