• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Numeric or varchar2?

 
Prithiraj Sen Gupta
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Paul Campbell
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In general, a numeric surrogate key is faster.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic