来源 Oracle插入性能小测

[ 2009-11-3 15:53:17 | 作者: 一线风 | 阅读:641 | 评论:0 | 天气: sunny | 心情: normal ]
Font Size: Large | Medium | Small

因为测试一些东东,需要一些数据,因此就写了个增加数据的东东。这个一来能满足写入的数据,二来能顺便测试一下Oracle的性能。

 

SQL代码
  1.  declare  
  2. maxrecords constant int:=1000000;   
  3. int :=1;   
  4. Begin  
  5. for i in 1..maxrecords loop   
  6. Insert into TEST_TEMP(NAMEvalues (SYS_GUID());   
  7. end loop;   
  8. dbms_output.put_line(' OK ');   
  9. commit;   
  10. end;   
  11.   
  12. --100W 325.969 s  


服务器环境:

linux as 4 + oracle 10g 内存1G,Xeon3.0G 处于Windows平台下的虚拟机。

差不多每秒种3000多条数据,第二次执行的时候是318秒多一点。

select count(0) from test_temp 时约0.2秒大右,加上ID> 300000的条件,为0.02秒左右。

[一线风 最后修改于 2009-11-3 16:07:29]
分类:学习参考
Tag: Oracle 性能