Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: unsequential sequences
Sybrand Bakker wrote:
> On 8 Jul 2005 13:23:06 -0700, "Kevin Blount" <kevin_at_questionmark.com> > wrote: > >
> > > Sequences are primarily intended for surrogate keys. Which means the > number really doesn't have any meaning at all. > That said, sequences are not guaranteed to be assigned without holes. > Ie, if you select a sequence value, but roll back the transaction, the > sequence isn't lowered, so you 'loose' a sequence number. > This is of course documented. > If you want sequences to be ordered, you need to define them ordered. > The default is noorder, as documented. > If you want to 'loose' less sequences numbers, you need to make sure > you define them nocache. By default 20 values are cached, as > documented. You can define them with nocache, evidently with some > performance penalty associated (because Oracle would have to read and > update it's internal sequence table every time). > > In short, if you don't want 'holes', don't use sequences. > And please read the documentation before posting. > > > -- > Sybrand Bakker, Senior Oracle DBA
The fact that his DBA doesn't know all this is what struck me as a concern.
-- Ed Prochak running http://www.faqs.org/faqs/running-faq/ netiquette http://www.psg.com/emily.html -- "Two roads diverged in a wood and I I took the one less travelled by and that has made all the difference." robert frostReceived on Fri Jul 08 2005 - 22:35:31 CDT
![]() |
![]() |