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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: select <sequence>.nextval from dual contributes to poor performan

Re: select <sequence>.nextval from dual contributes to poor performan

From: Connor McDonald <hamcdc_at_yahoo.co.uk>
Date: Thu, 03 Oct 2002 01:28:33 -0800
Message-ID: <F001.004DF02B.20021003012833@fatcity.com>


Most commonly this is due to poor coding, where "poor" means the sequence value is obtained explicitly in a trigger or before the insert/update/etc is done.

Certainly plain old "insert into xxx values (bbb.nextval, ... )"

is a lot faster than

  1. select nextval from dual
  2. do insert

and the former is also a lot nicer on indexes as well.

The other thing is that you'll see that 'select ... from dual' is 5 logical IO's. I you can change the app to query from a "local_dual" table stored as an IOT then this drops significantly. Alternatively, you could have a local dual which is a synonym to SYS.X$DUAL. Its a question of whether your app supports such mods

hth
connor


Connor McDonald
http://www.oracledba.co.uk
http://www.oaktable.net

"Remember amateurs built the ark - Professionals built the Titanic"



Do You Yahoo!?
Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: =?iso-8859-1?q?Connor=20McDonald?=
  INET: hamcdc_at_yahoo.co.uk

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Thu Oct 03 2002 - 04:28:33 CDT

Original text of this message

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