-
Notifications
You must be signed in to change notification settings - Fork 25.2k
ESQL: Verify PushDownEval/Enrich/RegexExtract logical optimizer rules correctness #105043
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) |
I'm renaming this issue and eventually labeling it differently, because |
What these rules doAll these three rules swap if (child instanceof OrderBy orderBy) {
return orderBy.replaceChild(eval.replaceChild(orderBy.child()));
} These are not properly optimization rules, the reason for their existence is described in PushDownEval javadoc (expand this for details)the goal is to group SORT commands together At this point, In the example above, the first SORT has no semantic value: even if the data are sorted by The problemThe problem happens when
will be converted to
Two problems here:
Actual failuresUnfortunately, reproducing the problem above is possible also with simple and reasonable queries:
|
performance considerationsThese rules also have a significant impact on the efficiency of the execution plan. At a very high level, In addition, Practically, these problems can be easily reproduced with the following query:
With pushdown rules enabled (that is the state of the art)the physical plan is the following:
and the local physical plan is the following
With pushdown rules disabledthe physical plan is the following:
and the local physical plan is the following
The difference is substantial:
In a production scenario with a large dataset, this query would fail with timeout. |
@luigidellaquila any updates on this one? |
This logic had significant refactoring in last 12 months, so this issue is no longer completely relevant. |
Description
Double check
PushDownEnrich
correctness in being pushed down within the plan. Add unit tests both at the logical and physical plan along with more CSV tests for various scenarios: with/without filters (some that can be pushed down, some that do not), projections and evals.Relates #104957
The text was updated successfully, but these errors were encountered: