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: Meaningful surrogate primary keys

Re: Meaningful surrogate primary keys

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 20 Mar 2003 18:33:56 -0800
Message-ID: <2687bb95.0303201833.4c9ccbe3@posting.google.com>


mohsin_nadeem_at_hotmail.com (MnM) wrote in message news:<e9582440.0303201546.73118ed0_at_posting.google.com>...
> I've a hierarchy (dept of more than 4-6 tables) of tables with
> parent-child relationship. In OO terms, you can think of it as
> ?composite' relationship. I'm using meaningful surrogate PK for each
> table, such that PK of table A will be a FK in table B and will be a
> part of B's PK and same with table C i.e. B's PK is C's FK and also
> part of C's PK. Here is an example:
>
> Tables (in parent-child sequence): A, B, C
>
> Table A: PK = aa
> Table B: PK = aabb FK = aa
> Table C: PK = aabbcc FK = aabb
>
> Now, I want to know, does it effects performance in Oracle when
> surrogate keys are lengthy e.g. 20+ chars? If it does, please suggest
> a good solution.
>
> Thanks.

The answer depends on what you mean by "does it effects [sic] performance". In general single column keys and shorter keys have a performance edge over longer keys; however, in most actual practice you will be hard pressed to be able to tell the difference. We have numerous tables whose key exceeds 20 bytes and retrieval performance against these tables using the key is very good.

HTH -- Mark D Powell -- Received on Thu Mar 20 2003 - 20:33:56 CST

Original text of this message

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