如下另个语句update t1 set (a1,b1) = (select a2,b2 from t2 where t1.c1 = '2008-05-31' and t1.d1 = t2.d2) where t1.c1 = '2008-05-31' and t1.d1 in (select d2 from t2)update t1 set (a1,b1) = (select a2,b2 from t2 where t1.d1 = t2.d2) where t1.c1 = '2008-...
显示全部如下另个语句
update t1 set (a1,b1) = (select a2,b2 from t2 where t1.c1 = '2008-05-31' and t1.d1 = t2.d2) where t1.c1 = '2008-05-31' and t1.d1 in (select d2 from t2)update t1 set (a1,b1) = (select a2,b2 from t2 where t1.d1 = t2.d2) where t1.c1 = '2008-05-31' and t1.d1 in (select d2 from t2)其中c1,d1为t1的索引,d2为t2的主键。sql执行时先ixscan t1表找到符合条件的记录,再去连表t2,还是先t1与t2表内连接,然后再根据t1表的条件筛选?这两句sql哪个性能更优?
收起