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

Home -> Community -> Usenet -> c.d.o.server -> Re: Composite Primary key or 1 primary key column with all values

Re: Composite Primary key or 1 primary key column with all values

From: Carsten Alexander <acamat_at_web.de>
Date: Sun, 11 Aug 2002 16:24:10 -0000
Message-ID: <aj5s5t$191cm0$1@ID-86275.news.dfncis.de>


Hi Marc,

"Marc" <Marc-Weinstock_at_si.rr.com> wrote in message news:fe_49.195542$QD2.43806028_at_twister.nyc.rr.com...

> Which is faster? 6 columns or 1 column with all keys. Speed is the only
> issue.
> col1 varchar(3) = aaa
> col2 varchar(3) =bbb
> col3 date =12/31/01
> col4 number(1) =1
> col5 number(1) = 0
> col6 number(1) =1
>
> OR
>
> one_column varchar2(20) = "aaabbb12312001101"

What would about using a single counter as primary key and build a unique constraint for the "keyfields"? This makes the selects much more easier (Insted of ... WHERE col1 = value1 and col = value2, ... now where key = value). So you use a "simple" reference to other tables and get much more performance. How you think about that?

--
Regards,
Carsten
Received on Sun Aug 11 2002 - 11:24:10 CDT

Original text of this message

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