-
Notifications
You must be signed in to change notification settings - Fork 25.2k
ESQL: Skip LOOKUP JOIN when join key is missing from index #125577
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
Comments
Pinging @elastic/es-analytical-engine (Team:Analytics) |
The lookup can be completely reworked into a simple projection (due to being a left join) that references the left and right fields. The right side would have had the fields already added as null so
One potential complication is in returning data from the optimized data node in a format suitable for the consumer on the coordinator. P.S. |
This is only true if the names on the left/right hand sides are qualified (once we have qualifiers) due to name conflict handling. (There is always at least 1 name conflict, by design, specified via the
That's what I had in mind. The last
Not sure that's true in general, because the
Yep, there's some optimization potential here when we run |
ReplaceMissingFieldWithNull
will check if the indices of a data node even have a given field, and if not, will define a literalNULL
in its place to avoid extracting null blocks.When the join key for a
LOOKUP JOIN
is missing on the data node, we could optimize away the whole join rather than extracting null blocks and then performing lookups with them.Or, at least we should check that the current implementation is sufficiently cheap - but I think it's likely not in cases where we fan out to loads of data nodes, many of which just don't have values for the join key; like in
FROM * | LOOKUP JOIN lu_idx ON some_rather_rare_field | SORT whatever_field
.The text was updated successfully, but these errors were encountered: