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: Optimizing long string foreign keys

Re: Optimizing long string foreign keys

From: Noons <wizofoz2k_at_yahoo.com.au>
Date: Fri, 8 Aug 2003 22:09:53 +1000
Message-ID: <3f3393f2$1$10355$afc38c87@news.optusnet.com.au>


"Boris Pelakh" <pelakh_at_yahoo.com> wrote in message news:44ec9ada.0308070547.7fb3611b_at_posting.google.com...

> How can I resolve this problem ? I have considered auto-sequencing
> table A,
> and storing just the sequence number as a reference in table B, but I

That technique is called "using a surrogate key". It is quite effective at solving this problem.

> have
> a frequent need to do the following
>
> select <fields> from TableB where TableA_key = '<some value>';
>
> which would now force a JOIN. Is there a better solution ?

Nothing wrong with a join. If it is indexed properly, it is nearly as fast as a single table access. I'm assuming this long key is unique.

--
Cheers
Nuno Souto
wizofoz2k_at_yahoo.com.au.nospam
Received on Fri Aug 08 2003 - 07:09:53 CDT

Original text of this message

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