Re: optimum datatype for primary key column O9i

From: Max Pieh <maxp_at_everymail.net>
Date: 29 Oct 2003 09:03:40 -0800
Message-ID: <678574d.0310290903.324875a5_at_posting.google.com>


> >
> > Thanks,
> > Now as I need only
> > - integer values and of
> > - 12 digit positions all filled (i.e. maximum 1 or 2 leading zeroes)
> >
> > in an attempt to optimise
> > I will declare as NUMBER(12,0)
> >
> > Q. Is the storage pattern same if the number is shorter say NUMBER(10,2)
> > except off course the saving of say one byte per value
> > specially in indexes (I can even go shorter if required)
> >
> > and ...
> >
> > Q is there any overheads in joins when using NUMBER datatype
> > The highest use of the primary key will be in Joins
> > and the implicit internal index accesses and comparisions
> > in joins.
> >
> > There will hardly be any other use of the primary key values
> >
> > Regards
> > Sanjay Minni
>
> You DON'T NEED leading zeroes, and you can't store them in a number
> datatype (which is good, as leading zeroes is a *display* property).
> Number(10,2) means you have 10 positions, of which 2 are used as
> fraction.
> There is NO overhead in using a NUMBER datatype in joins!!
> There is overhead in using VARCHAR2s (which you already demonstrate as
> you seem to feel compelled mistakenly to pad them)
>
> Could you please brush up your manual reading skills? It's all there.
>
> Sybrand Bakker
> Senior Oracle DBA

How can anyone give such a rude and incompetent answer to a sensible question?

Nobody claimed that leading zeroes can be stored in a number datatype.

The question is:
 Does declaring a column as number(10,0) make it need less memory storage than declaring it simply as number?

Are search operations which use the index faster when the index column is declared as number(10,0) as compared to when it is declared as number?

regards,
Max Received on Wed Oct 29 2003 - 18:03:40 CET

Original text of this message