Skip to content

Commit 9d4ceb5

Browse files
committed
planner: fix TPC-H's Q4 cannot be pushed down to TiFlash
1 parent 8f2aaf8 commit 9d4ceb5

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

pkg/planner/core/casetest/tpch/tpch_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ CREATE TABLE lineitem (
183183
`)
184184
testkit.SetTiFlashReplica(t, dom, "test", "orders")
185185
testkit.SetTiFlashReplica(t, dom, "test", "lineitem")
186-
//tk.MustExec(`set @@session.tidb_enforce_mpp=1;`)
187-
tk.MustQuery(`explain format='cost_trace' select /*+ read_from_storage(tiflash[lineitem,orders]) */
186+
tk.MustExec(`set @@session.tidb_enforce_mpp=1;`)
187+
tk.MustQuery(`explain select
188188
o_orderpriority,
189189
count(*) as order_count
190190
from

pkg/planner/core/find_best_task.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,10 @@ func enumeratePhysicalPlans4Task(
207207
fd = logicalPlan.ExtractFD()
208208
}
209209
}
210-
for _, pp := range physicalPlans {
210+
if !p.SCtx().GetSessionVars().InRestrictedSQL && len(physicalPlans) == 7 {
211+
fmt.Println("wwz")
212+
}
213+
for idx, pp := range physicalPlans {
211214
timeStampNow := p.GetLogicalTS4TaskMap()
212215
savedPlanID := p.SCtx().GetSessionVars().PlanID.Load()
213216

@@ -271,7 +274,9 @@ func enumeratePhysicalPlans4Task(
271274
break
272275
}
273276
appendCandidate4PhysicalOptimizeOp(opt, p, curTask.Plan(), prop)
274-
277+
if !p.SCtx().GetSessionVars().InRestrictedSQL && idx == 3 {
278+
fmt.Println("wwz")
279+
}
275280
// Get the most efficient one only by low-cost priority among all valid plans.
276281
if curIsBetter, err := compareTaskCost(curTask, bestTask, opt); err != nil {
277282
return nil, 0, err

0 commit comments

Comments
 (0)