create or replace procedure a_jsbp as cursor a is select b.id from a_bjb b;
bjid varchar2(40);
begin
open a;
loop
fetch a into bjid;
update a_bjb bj set bj.rs =( select count(*) from a_xsb a where a.bjid =bjid and bj.id =bjid) ;
commit;
exit when a%notfound;
end loop;
close a;
end;
其中a_bjb有1000条数据, a_xsb 有10W条数据,数据更新进行了10分钟还在进行。。
bjid varchar2(40);
begin
open a;
loop
fetch a into bjid;
update a_bjb bj set bj.rs =( select count(*) from a_xsb a where a.bjid =bjid and bj.id =bjid) ;
commit;
exit when a%notfound;
end loop;
close a;
end;
其中a_bjb有1000条数据, a_xsb 有10W条数据,数据更新进行了10分钟还在进行。。
2、像2楼说的,频繁进行IO操作,影响数据库读写操作