Re: optimum datatype for primary key column O9i
Date: 28 Oct 2003 08:46:28 -0800
Message-ID: <4fe109d.0310280846.5833135d_at_posting.google.com>
sybrandb_at_yahoo.com wrote in message news:<a1d154f4.0310280118.1f47d7a2_at_posting.google.com>...
> sminni_SPAM_DIVERTER_at_planage.com (Sanjay Minni) wrote in message news:<4fe109d.0310271823.58b3b2c8_at_posting.google.com>...
> > [snip...]what will be the optimum datatype to be used
> > [for 12 digit key lengths] to make best use
> > of space [data & index] and speed of access [joins etc].
>
> If your key is numeric, one of the most stupid moves you can make is
> storing them in varchar2s. Numeric columns are packed, varchar2
> columns aren't. Also you are likely to end up with implicit conversion
> issues if someone mistakenly writes queries like this one
> key_column = 1234.
> This will be automatically converted by Oracle to
> to_number(key_column) = 1234
> and consequently the primary key index will not be used.
>
Sanjay
Sanjay Minni Received on Tue Oct 28 2003 - 17:46:28 CET