Re: Foreign key constraints or indexes...which comes first?
From: Chris Hamilton <chamilton_at_sratech.com>
Date: 1995/09/18
Message-ID: <43incb$sah_at_news.cais.com>#1/1
Date: 1995/09/18
Message-ID: <43incb$sah_at_news.cais.com>#1/1
biggsbm_at_aol.com (BiggsBM) wrote:
>When you declare a foreign key constraint on a table, I think Oracle
>checks all rows in that table to make sure that their keys do exist in the
>referenced table. And when you create an index on the values in a foreign
>key, I think Oracle also goes through all of the rows in order to create
>the index.
>
>Does anyone know if creating an index before creating foreign keys is any
>faster than creating the foreign keys first? Or is there really no
>difference in speed since Oracle has to go through all of the values
>anyway for both the foreign key and index creation?
>
>Thanks,
>Brian Biggs
>(bbiggs_at_cincom.com)
My opinion is its a full table scan either way.
-- +------------------------------+ | Chris Hamilton | | chamilton_at_sratech.com | | SRA Technologies, Inc. | | City of Washington Pipe Band | +------------------------------+Received on Mon Sep 18 1995 - 00:00:00 CEST