-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Broadcast the larger side during join if colA + colB >5 condition is specified #15605
Comments
What is correct estimate? |
the desired plan should be table scan of sn_result_hourly on the left of the join, since it has much more rows than table sn_articles_export_hourly. |
@ubyyj could you run explain analyze also? |
run_analyze_bad_query_plan.txt attached is the result of explain analyze |
Could you also provide the output of |
|
I think this is due to the optimizer not handling unknown stats correctly in the relevant part of the code. |
@raunaqmorarka ANALYZE can fix the issue. |
It is a bug, just wanted to confirm that explicitly generating column stats solves the problem. |
we are suing trino version 377, and found that it generates very inefficient plan, broadcasting the much larger table, if a condition like
colA + colB >5
is given.Below is the query:
Table sn_result_hourly is much larger, but the query plan shows it broadcast this larger table during join. But if remove the condition
and (read_time_web + read_time_smart) >= 5
, then the plan looks good.Please find the incorrect query plan in the attached file.
broadcast_larger_side_plan.txt
for your convenience, here is the key part of the plan:
The text was updated successfully, but these errors were encountered: