大表 update 方式

时间:2014-12-31 16:00:28   收藏:0   阅读:132
--

declare
  cursor cur_t is
    select rowid rid from tpr_zwjyw3 where dwid=10113222;
  type tab_t is table of urowid index by binary_integer;
  l_rid tab_t;
begin
  open cur_t;
  loop
    fetch cur_t bulk collect
      into l_rid limit 45000;
    forall idx in 1 .. l_rid.count
      update tpr_zwjyw3 t set t.zh =没有 where rowid = l_rid(idx);
    commit;
    exit when cur_t%notfound;
  end loop;
  close cur_t;
end;

千万级别的数据 update 或delete  效果明显

原文:http://www.cnblogs.com/tianmingt/p/4195754.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!