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

Home -> Community -> Usenet -> c.d.o.misc -> Performance of sequences as primary key generators.

Performance of sequences as primary key generators.

From: Ben Harmon <benh_at_dascom.com>
Date: 1997/06/24
Message-ID: <5op2e3$9an@news9.noc.netcom.net>#1/1

A sequence, as I understand it, is actually just another table that is being incremented by a procedure that is run when the NEXTVAL statement is issued. Is it correct to say that the following are issued when a sequence is utilized to generate a primary key?

  1. The original "INSERT" statement is issued to 'emp' table.
  2. The SQL is stored in the SGA while
  3. A trigger is called which
  4. Performs a "SELECT" from the emp.sequence table and
  5. Performs an "UPDATE" to the emp.sequence table and
  6. Writes the NEXTVAL value to the emp table and THEN
  7. The original SQL is executed, involving yet another write.

I realize this is crude, but is it roughly correct? This seems like a lot of overhead. Does anybody have any input on this? I am a beginner, and am very open to new information.

If there is another way to generate primary keys for a table, I would love to hear it.

Thanks,



Ben Harmon
ben_at_dascom.com.nospam
**Please remove .nospam suffix if you want to mail me**
Received on Tue Jun 24 1997 - 00:00:00 CDT

Original text of this message

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