Skip to content
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

Revert "planner: update the cost formula of IndexJoin+IndexLookup" #39704

Merged
merged 11 commits into from
Dec 7, 2022
5 changes: 0 additions & 5 deletions planner/core/plan_cost_ver2.go
Original file line number Diff line number Diff line change
Expand Up @@ -593,11 +593,6 @@ func (p *PhysicalIndexJoin) getIndexJoinCostVer2(taskType property.TaskType, opt
// Use an empirical value batchRatio to handle this now.
// TODO: remove this empirical value.
batchRatio := 6.0
if _, isIndexLookUp := probe.(*PhysicalIndexLookUpReader); isIndexLookUp {
// IndexJoin + IndexLookUp has the risks to cause massive double-read requests,
// set the batchRatio to a lower value in this case for safety.
batchRatio = 1.5
}
probeCost := divCostVer2(mulCostVer2(probeChildCost, buildRows), batchRatio)

p.planCostVer2 = sumCostVer2(startCost, buildChildCost, buildFilterCost, buildTaskCost, divCostVer2(sumCostVer2(probeCost, probeFilterCost, hashTableCost), probeConcurrency))
Expand Down