Home » SQL & PL/SQL » SQL & PL/SQL » sequence cache (oracle 10 g)
sequence cache [message #499124] Sun, 13 March 2011 15:40 Go to next message
miroconnect@yahoo.com
Messages: 202
Registered: April 2006
Senior Member
is it a advised to cache sequnence

all my sequence scripts has a cache of 20

here is the script

CREATE SEQUENCE APP_TEMP_SEQ
  START WITH 1000400
  MAXVALUE 999999999999999999999999999
  MINVALUE 1
  NOCYCLE
  CACHE 20
  NOORDER;

is there any draw back caching sequence ?
I noticed in my tables several sequences are skipped please advice me
Re: sequence cache [message #499126 is a reply to message #499124] Sun, 13 March 2011 15:42 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>I noticed in my tables several sequences are skipped please advice me
Cached values become gaps when DB shuts down & restarts
This is expected behavior.
Re: sequence cache [message #499127 is a reply to message #499124] Sun, 13 March 2011 15:46 Go to previous message
Michel Cadot
Messages: 68764
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
There are many drawbacks to NOT cache.
And the first one is performances.


Sequence gaps is not a drawback, it is the expected behaviour. All sequences even, without cache, will have gaps.

Regards
Michel
Previous Topic: public synonym
Next Topic: Update String anywhere in text
Goto Forum:
  


Current Time: Sat Aug 02 21:22:59 CDT 2025