update /*+ gather_plan_statistics */ wxh_tbd a
set (object_id, object_name) = (select object_id, object_name
from wxh_tbd b
where a.object_id = b.object_id);
set (object_id, object_name) = (select object_id, object_name
from wxh_tbd b
where a.object_id = b.object_id);
试了N种办法,都走不上HASH。
改写如下:
update (
select /*+ BYPASS_UJVC use_hash(a b) ordered */ a.object_name,a.object_id,b.object_name new_object_name,b.object_id new_object_id
from wxh_tbd a, wxh_tbd b
where a.object_id=b.object_id
) set object_name=new_object_name,object_id=new_object_id
;
select /*+ BYPASS_UJVC use_hash(a b) ordered */ a.object_name,a.object_id,b.object_name new_object_name,b.object_id new_object_id
from wxh_tbd a, wxh_tbd b
where a.object_id=b.object_id
) set object_name=new_object_name,object_id=new_object_id
;
如果OBJECT_ID是唯一索引,就不用加BYPASS_UJVC 了
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22034023/viewspace-722640/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/22034023/viewspace-722640/
1346

被折叠的 条评论
为什么被折叠?



