Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Primary key type selection
This seems to be related to my post of VARCHAR2 vs. CHAR, to which I have
no direct responses.
My concern is towards both performance and a tighter data model. If primary
keys
(foreign keys in other tables) are allowed to vary in length, then the
comparison at
search time becomes looser and therefore must take longer, or at best be no
better ever.
It also allows for more error in the human interaction ('0270' is same as
'00270', '0270 ', etc.).
It seems that numbers are most severely restricted in the variety of entries
possible,
followed by CHAR, followed by VARCHAR2. This is the order of my personal
preference
for primary keys.
Akshay Jain
![]() |
![]() |