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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Indexes part II

Re: Indexes part II

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Mon, 22 Nov 1999 07:02:22 -0500
Message-ID: <r3ci3s0123k9p4n9e9u26g21kr30i13iad@4ax.com>


A copy of this was sent to "Cherk" <andrija.cerkez_at_lijanovici.com> (if that email address didn't require changing) On Mon, 22 Nov 1999 11:31:59 +0100, you wrote:

>Thank's Sybrand Bakker !
>
>I have additional questions.
>
>1. Is it true:
>
>"When I defined primary and unique key in Oracle 7, indexes on them
>is immediatly created"
>

either that OR an existing index on the columns is 'taken' over (eg: you can create a unique index on a table T column x. if you alter table t add constraint t_pk primary key(x) -- that index will be 'taken' over by the primary key constraint.

>2. May I define index on foreign key immediatly when I created table and
>defined foreign constraint, or I need to do this after with statement Create
>index ...
>

do it whenever. foreign keys do not *need* an index (but see the website in my signature for the reasons why you really do want to index foreign keys 99% of the time).

>
>----------------------------------------------------------------------------
>--------------
>I have the simplest tastes. I am always satisfied with the best.
>----------------------------------------------------------------------------
>--------------
>Cherk (andrija.cerkez_at_lijanovici.com), Siroki Brijeg, Croatia
>Cherk's home page (http://www.angelfire.com/co/Cherk)
>

--
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Mon Nov 22 1999 - 06:02:22 CST

Original text of this message

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