-
Notifications
You must be signed in to change notification settings - Fork 25.6k
ESQL: Reduce iteration complexity for plan traversal #123427
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
Conversation
Pinging @elastic/es-analytical-engine (Team:Analytics) |
Hi @costin, I've created a changelog YAML for you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
IIUC, the last loop should only run on a leaf, so practically "just" ^2?
I guess the calling sites could now also use a list instead of a hash set to collect the indices.
(cherry picked from commit e4604a4)
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
Fixes the iteration to calling a full tree navigation per node (forEach already performs a full tree traversal) so it's back to O(N) instead of O(N^3) (forEach, call forEach per node, which calls forEach per child).