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: Marc <Marc-Weinstock_at_si.rr.com>
Date: Sat, 10 Aug 2002 23:24:40 GMT
Message-ID: <Ygh59.197156$QD2.44499243@twister.nyc.rr.com>


I forgot to mention that I if I went with the 1 column approach, then I would have all 7 columns. 1 for the combined primary key and the other 6 columns separated out. The six will be kept so I can search on 1 particular value if needed and display the values would be easier. The 1 primary key will be only used to lookup the particular row. I would probably have a trigger to perform the concatenation. I will never use substring on the primary key column. BTW, this is a dss system, no transactions. Speed is the issue.

"Sybrand Bakker" <postbus_at_sybrandb.demon.nl> wrote in message news:aic9luk3a5n54nq263oju4jotvpuvb47nv_at_4ax.com...
> On Sat, 10 Aug 2002 01:44:43 GMT, "Marc" <Marc-Weinstock_at_si.rr.com>
> wrote:
>
> >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"
> >
> >I have a few tables with the same primary key. For perfomce only. does
> >anyone know? MultiMillion row table.
> >
> >
>
> If you take the second route you will soon regret that, and it will
> create a messy application, as you will soon need to 'parse'
> one_column *everywhere*. So : speed is not a consideration here,
> maintainability is. Choose for the second route and prepare to travel
> to hell.
> And storing dates as strings is definitely a *BAD* idea.
> A few tables with the same primary key also looks like you have severe
> problems in your datamodel.
>
>
> Regards
>
>
>
> Sybrand Bakker, Senior Oracle DBA
>
> To reply remove -verwijderdit from my e-mail address
Received on Sat Aug 10 2002 - 18:24:40 CDT

Original text of this message

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