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: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Sat, 10 Aug 2002 16:13:05 +0200
Message-ID: <aic9luk3a5n54nq263oju4jotvpuvb47nv@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 - 09:13:05 CDT

Original text of this message

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