-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Optimizer does not consider the cost of other condition in Index Join #20710
Copy link
Copy link
Closed
Closed
Copy link
Labels
affects-6.5This bug affects the 6.5.x(LTS) versions.This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.This bug affects the 8.1.x(LTS) versions.affects-8.5This bug affects the 8.5.x(LTS) versions.This bug affects the 8.5.x(LTS) versions.priority/release-blockerThis issue blocks a release. Please solve it ASAP.This issue blocks a release. Please solve it ASAP.report/customerCustomers have encountered this bug.Customers have encountered this bug.severity/criticalsig/plannerSIG: PlannerSIG: Plannertype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.
Milestone
Metadata
Metadata
Labels
affects-6.5This bug affects the 6.5.x(LTS) versions.This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.This bug affects the 8.1.x(LTS) versions.affects-8.5This bug affects the 8.5.x(LTS) versions.This bug affects the 8.5.x(LTS) versions.priority/release-blockerThis issue blocks a release. Please solve it ASAP.This issue blocks a release. Please solve it ASAP.report/customerCustomers have encountered this bug.Customers have encountered this bug.severity/criticalsig/plannerSIG: PlannerSIG: Plannertype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
SQL is
If Index Join is used, currently t1.a = t2.a is put in the equality condition, and t1.b = t2.b is put in other conditions. If the selectivity of t1.a = t2.a is high, there will be quite a lot of rows that need to be filtered with t1.b = t2.b. This part of the cost will be very large.
If Hash Join is used, t1.a = t2.a and t1.b = t2.b will be put in equal condition. There is no such problem.
2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. What is your TiDB version? (Required)