Re: Performance of Multiple Inserts
Date: 1995/08/11
Message-ID: <40eee7$9il_at_data.interserv.net>#1/1
> droberts_at_seas.gwu.edu (David Roberts) writes:
> A friend of mine has written a simple Oracle program that he thinks
> should run in a couple of hours, that now appears to need 48 days to
> complete! I offered to ask for advice here....
>
> The program is a simple load utility, loading a lot of payroll data into
> a database. The program is generating test data, so it just does
> inserts. At present, it COMMITs after every insert. In an effort to
> speed things up, the program was run simultaneously from four clients
> accessing the same server, and there was about 3 x speedup, but we are
> still talking about 16 days to build our test database!
>
> A couple of questions--
>
> 1. I suspected that the program might run faster if it committed about a
> whole pageful of data and then COMMITted, rather than issuing a COMMIT
> after each INSERT. What do you think?
>
> 2. Would that same strategy help for the multiple-client case? Are the
> multiple clients each going to work with the same page of data, hence
> have to wait on each other, or will Oracle give each of them a separate page?
>
> Thanks
>
> Dave Roberts
>
>>>>
while( not done )
{ read 500 records
exec sql execute
begin
for i = 1 .. 500 loop
update table
set col1 = :col1(i),
col2 = :col2(i),
.
.
where pk_col = :pk_col(i);
if sql%rowcount = 0 then
insert into table
(col1, col2, ...)
values
(:col1(i), :col2(i));
end if;
end loop;
commit;
end;
end-exec;
)
If you have any questions, feel free to email me.
Will Kooiman,
Computer Systems Authority.
Received on Fri Aug 11 1995 - 00:00:00 CEST