Du kan prøve indsættelse af direkte sti for at fremskynde driften, men for 100 poster skal konventionel stiindsættelse være hurtig nok, og det ser ud til, at problemet handler om tabellåsning, mens der indsættes i log fra et stort antal kilder.
For at instruere Oracle til at bruge direkte stiindsættelse skal du angive enten TILFØJ eller APPEND_VALUES hints afhængigt af insert statement-syntaks. F.eks.
insert /*+ APPEND */
into multi_insert(val_1, val_2)
select * from (
select 100, 20 from dual union all
select 21, 2 from dual union all
select 321, 10 from dual union all
select 22, 13 from dual union all
select 14, 121 from dual union all
select 11, 112 from dual union all
select 112, 23 from dual union all
select 132, 2323 from dual union all
select 121, 34 from dual union all
select 24333, 333 from dual union all
select 1232, 3434 from dual union all
select 4554, 3434 from dual union all
select 3434, 211 from dual union all
select 3434, 1233 from dual union all
select 12, 22 from dual union all
select 356, 233 from dual union all
select 9347, 23 from dual union all
select 8904, 245 from dual union all
select 342, 4545 from dual union all
select 453, 233 from dual
)
Hvis insert statement stammer fra PL/SQL-kode, kan du bruge bulk insert med forall statement for at forbedre ydeevnen (SQLFiddle ) :
declare
type TRowList is table of multi_insert%rowtype index by binary_integer;
vRowList TRowList;
vRow multi_insert%rowtype;
begin
vRow.val_1 := 100;
vRow.val_2 := 20;
vRowList(0) := vRow;
vRow.val_1 := 21;
vRow.val_2 := 2;
vRowList(1) := vRow;
vRow.val_1 := 321;
vRow.val_2 := 10;
vRowList(2) := vRow;
-- ...
forall vIdx in vRowList.first .. vRowList.last
insert /*+ APPEND_VALUES */ -- direct path insert
into multi_insert values vRowList(vIdx);
end;