Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Database Key ?

Re: Database Key ?

From: Jerry Gitomer <jgitomer_at_hbsrx.com>
Date: Wed, 26 May 1999 12:00:38 -0400
Message-ID: <7ih5kr$53$1@autumn.news.rcn.net>


Hi Stefan,

    A good rule of thumb is "The shorter the key the better the performance." The reason is to keep as many keys in a data block as you can in order to minimize the number of index blocks that have to be read to locate the data you are after. Given that integer (NUMBER) results in the least amount of storage space for any given value you should use NUMBER if possible, if not use VARCHAR2.

regards

Jerry Gitomer



Stefan Herz wrote in message <374BDCC5.31151BA3_at_zdf.de>...
>Hello,
>two Questions i'm asking myself, may some of you have any ideas.
>For my Oracle Datenbase(7.3.4), later 8i i've to look for the best kind
>of keys for my tables.
>
>Question 1: Has the datatype of a key influence on the performance at
>skipping, data retrieving, adding or deleting?
>Should i use LONG,INTEGER oder VARCHAR(256), whats about a compound key?
>
>Questions 2: If i want to have a world wide unique key, e.g. using an
>URL and a sequence. Should i take a VARCHAR(256) or a compound key with
>a VARCHAR(xyz) and an INTEGER or LONG .
>According to Question 1.
>
>Are there any other criteria for the choice of a key type, instead
>ofunique,performance and flexibility ?
>
>Thanks for all of the advices may given
>regards Stefan
>
>
Received on Wed May 26 1999 - 11:00:38 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US