Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Should surrogate key be numeric?

user4900730Jun 16 2010 — edited Jun 16 2010
1. While on a data modleing course at Oracle, I was advised NOT to use numeric data types unless you needed to do numeric/arithmetic operations on the attribute. E.g. Even though an account_id is all digits it should still be declared as alpha numeric ( VARCHAR2) as it is NOT really a numeric. This makes sense.

I would like opnions on the above

2. If above advice is taken, then even a surrogate key should be alpha numeric since it does not require arithmetic/numeric computations. However, I have also heard that numerics are better than VARCHAR2 for joins. If this join performance advantage is true, then using a NUMBER data type for surrogate keys should be preferred over VARCHAR2? This overrides the advice in 1 above for join performance reasons.

I would like comments on 1 and 2.

Thanks

Edited by: user4900730 on Jun 16, 2010 12:19 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 14 2010
Added on Jun 16 2010
3 comments
1,834 views