Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Most efficient datatype for keys???
Z. Martinez wrote:
>
> I'm trying to determine the fastest datatype for a key?
> I will be using it as a primary key for a very large table.
>
> I'm currently using a number(10).
> Is there a more efficient datatype I can use for this purpose.
>
> Thanks in advance.
>
> Please respond to zlm101_at_psu.edu
The smallest column type which will allow you to uniquely code every row is about the best you can do. If you will have no more than 9,999,999, then a NUMBER(7) might work (assuming there is no loss of ID usage from deletions and subsequent inserts). Your NUMBER(10) will allow ten billion rows (now *that's* a BIG table).
But I really doubt that you will get a significant performance boot or drag by changing the key column by a few bytes. As long as the resulting key is unique and has an index on it... should be plenty snappy.
![]() |
![]() |