| Author |
Numeric or varchar2?
|
Prithiraj Sen Gupta
Ranch Hand
Joined: Sep 13, 2006
Posts: 92
|
|
which one of the following will be more faster and suitable for Primary Key with respect to Oracle 10g Database? 1. Numeric Field 2. Varchar2 Field Regards Prithiraj
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26144
|
|
Prithiraj, The choice should depend on what form of key data you have. If is a number, use the numeric type. Otherwise, use the varchar type. Both are suitable. If you want an auto-incrementable key, numeric is preferred. For speed, both can perform well since the primary key will be indexed.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
Paul Campbell
Ranch Hand
Joined: Oct 06, 2007
Posts: 338
|
|
|
In general, a numeric surrogate key is faster.
|
 |
 |
|
|
subject: Numeric or varchar2?
|
|
|