It there a performance impact when using the dual table to read a sequence' nextval over an direct insert?
I'm currently optimizing the performance in a large IT system and what I've found is that almost all sequence.nextval are read in the following way:
SELECT SOME_SQ.NEXTVAL INTO someID FROM DUAL;
insert into .... (someId)
I'm wondering whether the performance might suffer when using the way as described above over a standard:
insert into .... (some_sq.nexval, ...)
Thanks
Best Answer
Note that 11g has support for sequence expressions directly in PL/SQL
Otherwise, from the Oracle Docs:
So any performance gain will be slight. In the following tests I dropped and recreated the table and sequence between each execution:
testbed:
tests:
You should probably rerun these tests or ones like them in you own environment.