I am trying to implement a sequence in an Oracle database to act as a surrogate key creator for a table. For performance reasons, I want this sequence to be cached. I have rea
No, this will not be the case.
Your sequence will continue at 101
, the values between 50
and 100
will be missing.
The only reason to disable sequence caching is when trying to avoid gaps in your sequence, which is not relevant for most Primary Keys.
You might be interested in this article, which states that
The downside of creating a sequence with a cache is that if a system failure occurs, all cached sequence values that have not be used, will be "lost". This results in a "gap" in the assigned sequence values. When the system comes back up, Oracle will cache new numbers from where it left off in the sequence, ignoring the so called "lost" sequence values.