diff --git a/planner/core/plan_cache.go b/planner/core/plan_cache.go index a2002a6f18010..b6e5c3824781b 100644 --- a/planner/core/plan_cache.go +++ b/planner/core/plan_cache.go @@ -725,6 +725,11 @@ func containShuffleOperator(p PhysicalPlan) bool { if _, isShuffleRecv := p.(*PhysicalShuffleReceiverStub); isShuffleRecv { return true } + for _, child := range p.Children() { + if containShuffleOperator(child) { + return true + } + } return false }