Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: slow performance with sequences

Re: slow performance with sequences

From: Richard Kuhler <noone_at_nowhere.com>
Date: Tue, 09 Nov 2004 02:56:08 GMT
Message-ID: <clWjd.39009$jo2.35976@twister.socal.rr.com>


john b wrote:
> I'm curious to see if people are having the same slow performance with
> sequences that I'm having. In essence when I do a mass insert
> (525,000 records - it's a very narrow table) into a table without a
> sequence with a trigger the insert happens in two seconds; when I do
> the same with the trigger on and sequence used it takes 1 minute and 6
> seconds. The table does not have any indexes. I cached the sequence
> up to 10000 and that made very little difference. This occurs in both
> 8i (8.1.7.4) and 9i. For what it's worth SQL Server does this in 6
> seconds using an identity. (No I'm not trying to start a flame war -
> I just want to know if I'm doing something wrong.) The insert
> generates all of 6Mb of data, and my rollback segments consume this
> w/o any trouble. My CPU and I/O go up to 100% each time - yikes! I
> executed this test many times - and it resulted in the same
> performance every time.

<snip demo>

If you'll benchmark the difference between the trigger implementation and direct reference to the sequence during the insert, you should find that most of this overhead comes from the trigger and recursive SQL instead of the sequence. Using a trigger is certainly convenient and less error prone but it's not high performance.

--
Richard Kuhler
Received on Mon Nov 08 2004 - 20:56:08 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US