Skip to Main Content
  • Questions
  • Using sequences to populate primary keys

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, STEVEN.

Asked: April 27, 2012 - 10:36 am UTC

Last updated: May 02, 2012 - 5:05 pm UTC

Version: 11.2.2

Viewed 1000+ times

You Asked

Tom,

We have two developers that disagree about how use to sequences to populate primary keys. One uses one sequence to populate every primary key. The other creates one sequence per table. I was curious what your option is on each of these approaches.


Thanks





and Tom said...

http://asktom.oracle.com/pls/asktom/f?p=100:11:0::NO::P11_QUESTION_ID:2985886242221


I prefer the standard most widely used practice of "you create a sequence for an specific use" - I do not use a single sequence to populate multiple tables.


that is mostly opinion. At the end of the day - as long as you cache the sequence sufficiently - it is mostly six one way, half a dozen the other.

Is this answer out of date? If it is, please let us know via a Comment