Skip to content

ESQL: Review existing optimizations being applied on LOOKUP JOIN #127476

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

Closed
costin opened this issue Apr 28, 2025 · 2 comments
Closed

ESQL: Review existing optimizations being applied on LOOKUP JOIN #127476

costin opened this issue Apr 28, 2025 · 2 comments
Labels
:Analytics/ES|QL AKA ESQL >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)

Comments

@costin
Copy link
Member

costin commented Apr 28, 2025

Description

Due to the new nature of LOOKUP JOIN some existing optimizations don't get applied to it. For example:

FROM logs
| LOOKUP JOIN ips
| KEEP <fields from logs>
FROM logs
| LOOKUP JOIN ips
| STATS c = count()

In the queries above the LOOKUP JOIN can be completely removed since it doesn't affect the output.

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Apr 28, 2025
@alex-spies
Copy link
Contributor

In the queries above the LOOKUP JOIN can be completely removed since it doesn't affect the output.

I'm afraid that's not correct. LOOKUP JOIN does affect the number of rows because there can be multiple matches per input row. Just counting the rows after performing a LOOKUP JOIN is a valid thing to do IMO.

@costin , if you agree, I think this issue can be closed as not planned. We already have #119082 which tracks relevant optimizations - I'll add a note there to make sure there are no other existing optimizations that could or should be carried over to LOOKUP JOIN.

@alex-spies alex-spies closed this as not planned Won't fix, can't repro, duplicate, stale Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)
Projects
None yet
Development

No branches or pull requests

3 participants