home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.oracle      Overblown overpriced overengineered SHIT      2,288 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 611 of 2,288   
   Frank to Max Pieh   
   Re: optimum datatype for primary key col   
   29 Oct 03 23:09:07   
   
   From: fvanbortel@netscape.net   
      
   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   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca