From 40f8efd35062982e4f4f9278d528394d85245beb Mon Sep 17 00:00:00 2001 From: Yuanjia Zhang Date: Wed, 7 Dec 2022 14:35:31 +0800 Subject: [PATCH] Revert "planner: update the cost formula of IndexJoin+IndexLookup (#39617)" This reverts commit 1ddc5927c970166b083a76fe24757a06c099894e. --- planner/core/plan_cost_ver2.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/planner/core/plan_cost_ver2.go b/planner/core/plan_cost_ver2.go index 29524a345a3e1..b53d53c845c45 100644 --- a/planner/core/plan_cost_ver2.go +++ b/planner/core/plan_cost_ver2.go @@ -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))