diff --git a/plan/optimizer.go b/plan/optimizer.go
index <HASH>..<HASH> 100644
--- a/plan/optimizer.go
+++ b/plan/optimizer.go
@@ -30,7 +30,7 @@ func Optimize(ctx context.Context, node ast.Node, sb SubQueryBuilder, is infosch
 	if err := InferType(node); err != nil {
 		return nil, errors.Trace(err)
 	}
-	if !UseNewPlanner {
+	if _, ok := node.(*ast.SelectStmt); !ok || !UseNewPlanner {
 		if err := logicOptimize(ctx, node); err != nil {
 			return nil, errors.Trace(err)
 		}
let update/delete do old logicOptimize (#<I>)