Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Composite Primary key or 1 primary key column with all values
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, CarstenReceived on Sun Aug 11 2002 - 11:24:10 CDT