一聚教程网:一个值得你收藏的教程网站

热门教程

Oracle高效插入万行数据性能测试

时间:2022-06-29 09:59:42 编辑:袖梨 来源:一聚教程网


--创建测试表

 代码如下 复制代码

create table t_a(id number);

--使用循环直接插入数据
begin
  for i in 1..100000 loop
     insert into t_a(id) values(i);
  end loop;
end;

--使用Forall批量插入数据
declare
  type a_table_type is table of number index by binary_integer;
  v_a_s a_table_type;
begin
  for i in 1..100000 loop
     v_a_s(i) := i;
  end loop;
  --使用Forall插入数据
  forall m in 1..v_a_s.count
     insert into t_a values(v_a_s(m));
end;

 

 

执行结构:

Oracle执行Forall插入数据

热门栏目