begin
for i in 1..500 loop
update cj_full_detail_mat t set t.random=dbms_random.value(0,10000)
where t.status=40
and t.random is null
and rownum=1;
end loop
commit;
end 运行这个要13s
如果是改成for i in 1..1000 loop
要23s换成for i in 1..2000 loop要33s表的记录总共才5万
dbms_random.value怎么这么慢呢,有什么样方法可以加快点
for i in 1..500 loop
update cj_full_detail_mat t set t.random=dbms_random.value(0,10000)
where t.status=40
and t.random is null
and rownum=1;
end loop
commit;
end 运行这个要13s
如果是改成for i in 1..1000 loop
要23s换成for i in 1..2000 loop要33s表的记录总共才5万
dbms_random.value怎么这么慢呢,有什么样方法可以加快点
解决方案 »
- 如何获取FCKeditor编辑器中已经编辑好的html源码
- 高分求助,2条数据PK键值要互换,怎么操作呢?[
- 不同操作系统安装oracle
- 手动安装数据库的怪问题,一定要高手
- 面试题,请高手们看看
- 请教,Oracle中Package是一个怎样的概念,有了pck文件怎么将里面的东西(存储过程)放入新数据库?
- 晕,如此简单的触发器都报编译错误[求助]
- 各位DX,谁知道如何在已经建立好的表上修改列名!
- ”弱水三千“请进来。还是包的调用问题。急急急。。。。。。。。。。。。。
- 用oem导出数据成功了,但是导入时就显示失败,什么原因啊?请各位大神指教。。
- 无法连接虚拟机的ORACLE数据库
- 【小白】求解:' '(空格)在存储过程和pL/SQL sql window里的不同
2 for i in 1..500 loop
3 update cj_full_detail_mat t set t.random=dbms_random.value(0,10000)
4 where t.random is null
5 and rownum=1;
6 end loop
7 commit;
8 end
9 ;
10 /
PL/SQL procedure successfully completed
Executed in 0.109 seconds如果status项包含的值不多的话,加上位图索引试一试
where t.status=40
and t.random is null
and rownum<=500;
for i in 1..100 loop
update cj_full_detail_mat t set t.random=dbms_random.value(0,10000)
where t.status=40 and t.random is null and rownum<500;
end loop
if mod(i,1000)=0 then
commit;
end if;
end ;
你这样做,500行的random 都一样的了,我要得效果是每条记录的random都要很随机