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
Temporary incorrect query results occur after create table. #44314
Comments
|
|
It seems like the correct plan should be the following plan shows. The where filters should be put into a Selection but not the other conditions of the outer join.
|
The main reason is that 'outer join order'. I disable the 'tidb_enable_outer_join_reorder' and the where condition appears on the inner join other condition which is correct. The error plan is following: @winoros Please take a look ~ |
/assign @winoros |
/affect v6.5 ~ master |
v6.4 the 'tidb_enable_outer_join_reorder' is OFF in default so it is not affected |
mock the below code in
Reason: outer join's other condition influence is quite different from inner join's other condition, the latter one functions as a simple filter, just integrated with inner join. The former functions as a simple filter but also decides whether the outer join is matched or not, consequently deciding whether appending an additional null (which means this row itself is not pruned in the final result) So when enumerating join order when encountering inner join combined with outer join, those original other conditions bonded with an outer join, just let it be; those additional remained other conditions shouldn't be put down into it, adding additional selection above is a resolution. |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
3. What did you see instead (Required)
During a period of time after creating the table.
4. What is your TiDB version? (Required)
I can reproduce this bug in both
7.1.0
and6.6.0
.The text was updated successfully, but these errors were encountered: