Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Are too many Foreign Keys in one table bad?

RE: Are too many Foreign Keys in one table bad?

From: Burke, William F (Bill) <wbburke_at_avaya.com>
Date: Tue, 07 Jan 2003 06:44:29 -0800
Message-ID: <F001.005287F7.20030107064429@fatcity.com>


A couple of other thoughts depending on the size of the table with the large number of foreign keys (I may have missed the exact row counts), you might want to consider bitmaps on the foreign keys in the main table depending on the uniqueness of the data. Also, if the foreign key tables are relatively small another possibility to consider would be an indexed table if the joins would naturally grab the whole table.

Regards,

Bill Burke
"The Kinder and Gentler DBA"
Live 2003 Expert Presentation - Where there's smoke there's fire - Firefighter or Arsonist
IOUG University Master Class Faculty 2001-2002 "iDBA Management, High Performance Infrastructure and HA" IOUG Board of Directors 2000-2002
ODTUG Board of Directors 1996-2000
www.OracleGuru.com - All UMC and Conference Presentations are here www.KBMotorsports.biz

-----Original Message-----
Sent: Tuesday, January 07, 2003 2:59 AM
To: Multiple recipients of list ORACLE-L

And apart from the differences in cost on the simple test, you also remove the information about uniqueness and non-nullability if you don't declare the primary key, and this has an impact on the optimizer's decision tree.

Bear in mind, also, that Oracle will rarely do a tablescan on the inner table of a nested loop - so you may get a fifteen table hash join if you don't have any indexes, and this MIGHT go to one of the two possible extremes of demanding nearly 14 x hash_area_size in memory, or 14 allocations of temporary extents on your temporary tablespace.

Regards

Jonathan Lewis
http://www.jlcomp.demon.co.uk

Coming soon a new one-day tutorial:
Cost Based Optimisation
(see http://www.jlcomp.demon.co.uk/tutorial.html )

Next Seminar dates:
(see http://www.jlcomp.demon.co.uk/seminar.html )

____England______January 21/23
____USA_(CA, TX)_August

The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html

-----Original Message-----
To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> Date: 07 January 2003 02:45

>
>There can be quite a difference between using
>an index on a small table, and not using one.
>

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Jonathan Lewis
  INET: jonathan_at_jlcomp.demon.co.uk

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Burke, William F (Bill)
  INET: wbburke_at_avaya.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Tue Jan 07 2003 - 08:44:29 CST

Original text of this message

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