加了提示也不管用,还是很慢,大概10秒多。
SQL> set autotrace on
SQL> set timing on
SQL> update goods_info a
set class_id='111'
where
exists(
select goods_id from goods_code_relation b
where
b.class_mis_id='0103001' and
a.goods_id = b.goods_id
);
2 3 4 5 6 7 8 9
2 rows updated.
Elapsed: 00:00:10.61
Execution Plan
----------------------------------------------------------
0 UPDATE STATEMENT Optimizer=CHOOSE (Cost=773 Card=4016 Bytes=
96384)
1 0 UPDATE OF 'GOODS_INFO'
2 1 FILTER
3 2 TABLE ACCESS (FULL) OF 'GOODS_INFO' (Cost=773 Card=401
6 Bytes=96384)
4 2 TABLE ACCESS (BY INDEX ROWID) OF 'GOODS_CODE_RELATION'