Re: optimum datatype for primary key column O9i

From: Frank <fvanbortel_at_netscape.net>
Date: Wed, 29 Oct 2003 23:09:07 +0100
Message-ID: <bnpdbo$ndq$1_at_news1.tilbu1.nb.home.nl>


Max Pieh wrote:

>>>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
Because it's a non-issue. All the answers are there (OK, OK - some coding was actually left to the OP).

Give a man something to eat, and he will be hungry tomorrow, teach him how to fidh, and he'll never be hungry again. Or words the like.

Generally, we're not here to hold hands...

-- 
Regards, Frank van Bortel
Received on Wed Oct 29 2003 - 23:09:07 CET

Original text of this message