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: Primary Constraints and Indexes

RE: Primary Constraints and Indexes

From: Alex Hillman <alex_hillman_at_physia.com>
Date: Wed, 10 Jan 2001 14:55:37 -0500
Message-Id: <10737.126322@fatcity.com>


This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible.

------_=_NextPart_001_01C07B3F.4DB5D870
Content-Type: text/plain;

        charset="windows-1252"

And this index don't even need to bi unique (at least in 8i).

Alex Hillman

-----Original Message-----
From: Regina Harter [mailto:rharter_at_EMC-INC.COM] Sent: Wednesday, January 10, 2001 1:00 PM To: Multiple recipients of list ORACLE-L Subject: Re: Primary Constraints and Indexes

Wayne,

Yes, you are correct, the second index is unnecessary. Creating the primary key is the same index with the addition of a unique constraint and a not null constraint.

At 07:46 AM 1/10/01 -0800, you wrote:
>As a part-time dba, I am confused about the differences between
>Primary Keys and Indexes.
>
>For example if I create a table "EMPLOYEES" and in the table
>creation statement I do something like:
> create table ...
> constraint XXX primary key (EMP_ID) using index ...
>then later I create an index:
> create index YYY on EMPLOYEE (EMP_ID) ...
>I know I have created two indexes (the first one system-named
>and implicitly created and the second name YYY and created
>explicitly) but do I really need the second index YYY?
>It seems to me the YYY index is not really needed? Can
>someone shed some light on this for me.
>
>THANKS, Wayne
>McGillWL_at_navair.navy.mil
>
>--
>Please see the official ORACLE-L FAQ: http://www.orafaq.com
>--
>Author: Wayne McGill
> INET: McGillWL_at_navair.navy.mil
>
>Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
>San Diego, California -- Public Internet access / Mailing Lists
>--------------------------------------------------------------------
>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.com
-- 
Author: Regina Harter
  INET: rharter_at_emc-inc.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
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).

------_=_NextPart_001_01C07B3F.4DB5D870
Content-Type: text/html;
	charset="windows-1252"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dwindows-1252">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2448.0">
<TITLE>RE: Primary Constraints and Indexes</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>And this index don't even need to bi unique (at least =
in 8i).</FONT>
</P>

<P><FONT SIZE=3D2>Alex Hillman</FONT>
</P>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Regina Harter [<A =
HREF=3D"mailto:rharter_at_EMC-INC.COM">mailto:rharter_at_EMC-INC.COM</A>]</FON=
T>
<BR><FONT SIZE=3D2>Sent: Wednesday, January 10, 2001 1:00 PM</FONT>
<BR><FONT SIZE=3D2>To: Multiple recipients of list ORACLE-L</FONT>
<BR><FONT SIZE=3D2>Subject: Re: Primary Constraints and Indexes</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>Wayne,</FONT>
</P>

<P><FONT SIZE=3D2>Yes, you are correct, the second index is =
unnecessary.&nbsp;&nbsp; Creating the </FONT>
<BR><FONT SIZE=3D2>primary key is the same index with the addition of a =
unique constraint and </FONT>
<BR><FONT SIZE=3D2>a not null constraint.</FONT>
</P>

<P><FONT SIZE=3D2>At 07:46 AM 1/10/01 -0800, you wrote:</FONT>
<BR><FONT SIZE=3D2>&gt;As a part-time dba, I am confused about the =
differences between</FONT>
<BR><FONT SIZE=3D2>&gt;Primary Keys and Indexes.</FONT>
<BR><FONT SIZE=3D2>&gt;</FONT>
<BR><FONT SIZE=3D2>&gt;For example if I create a table =
&quot;EMPLOYEES&quot; and in the table</FONT>
<BR><FONT SIZE=3D2>&gt;creation statement I do something like:</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; create table =
...</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
constraint XXX primary key (EMP_ID) using index ...</FONT>
<BR><FONT SIZE=3D2>&gt;then later I create an index:</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp; create index YYY on EMPLOYEE =
(EMP_ID) ...</FONT>
<BR><FONT SIZE=3D2>&gt;I know I have created two indexes (the first one =
system-named</FONT>
<BR><FONT SIZE=3D2>&gt;and implicitly created and the second name YYY =
and created</FONT>
<BR><FONT SIZE=3D2>&gt;explicitly) but do I really need the second =
index YYY?</FONT>
<BR><FONT SIZE=3D2>&gt;It seems to me the YYY index is not really =
needed? Can</FONT>
<BR><FONT SIZE=3D2>&gt;someone shed some light on this for me.</FONT>
<BR><FONT SIZE=3D2>&gt;</FONT>
<BR><FONT SIZE=3D2>&gt;THANKS,&nbsp; Wayne</FONT>
<BR><FONT SIZE=3D2>&gt;McGillWL_at_navair.navy.mil</FONT>
<BR><FONT SIZE=3D2>&gt;</FONT>
<BR><FONT SIZE=3D2>&gt;--</FONT>
<BR><FONT SIZE=3D2>&gt;Please see the official ORACLE-L FAQ: <A =
HREF=3D"http://www.orafaq.com" =
TARGET=3D"_blank">http://www.orafaq.com</A></FONT>
<BR><FONT SIZE=3D2>&gt;--</FONT>
<BR><FONT SIZE=3D2>&gt;Author: Wayne McGill</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp; INET: =
McGillWL_at_navair.navy.mil</FONT>
<BR><FONT SIZE=3D2>&gt;</FONT>
<BR><FONT SIZE=3D2>&gt;Fat City Network Services&nbsp;&nbsp;&nbsp; -- =
(858) 538-5051&nbsp; FAX: (858) 538-5051</FONT>
<BR><FONT SIZE=3D2>&gt;San Diego, =
California&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Public Internet =
access / Mailing Lists</FONT>
<BR><FONT =
SIZE=3D2>&gt;-----------------------------------------------------------=
---------</FONT>
<BR><FONT SIZE=3D2>&gt;To REMOVE yourself from this mailing list, send =
an E-Mail message</FONT>
<BR><FONT SIZE=3D2>&gt;to: ListGuru_at_fatcity.com (note EXACT spelling of =
'ListGuru') and in</FONT>
<BR><FONT SIZE=3D2>&gt;the message BODY, include a line containing: =
UNSUB ORACLE-L</FONT>
<BR><FONT SIZE=3D2>&gt;(or the name of mailing list you want to be =
removed from).&nbsp; You may</FONT>
<BR><FONT SIZE=3D2>&gt;also send the HELP command for other information =
(like subscribing).</FONT>
</P>

<P><FONT SIZE=3D2>-- </FONT>
<BR><FONT SIZE=3D2>Please see the official ORACLE-L FAQ: <A =
HREF=3D"http://www.orafaq.com" =
TARGET=3D"_blank">http://www.orafaq.com</A></FONT>
<BR><FONT SIZE=3D2>-- </FONT>
<BR><FONT SIZE=3D2>Author: Regina Harter</FONT>
<BR><FONT SIZE=3D2>&nbsp; INET: rharter_at_emc-inc.com</FONT>
</P>

<P><FONT SIZE=3D2>Fat City Network Services&nbsp;&nbsp;&nbsp; -- (858) =
538-5051&nbsp; FAX: (858) 538-5051</FONT>
<BR><FONT SIZE=3D2>San Diego, =
California&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Public Internet =
access / Mailing Lists</FONT>
<BR><FONT =
SIZE=3D2>---------------------------------------------------------------=
-----</FONT>
<BR><FONT SIZE=3D2>To REMOVE yourself from this mailing list, send an =
E-Mail message</FONT>
<BR><FONT SIZE=3D2>to: ListGuru_at_fatcity.com (note EXACT spelling of =
'ListGuru') and in</FONT>
<BR><FONT SIZE=3D2>the message BODY, include a line containing: UNSUB =
ORACLE-L</FONT>
<BR><FONT SIZE=3D2>(or the name of mailing list you want to be removed =
Received on Wed Jan 10 2001 - 13:55:37 CST

Original text of this message

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