Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Primary Constraints and Indexes
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. 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>>As a part-time dba, I am confused about the = differences between</FONT> <BR><FONT SIZE=3D2>>Primary Keys and Indexes.</FONT> <BR><FONT SIZE=3D2>></FONT> <BR><FONT SIZE=3D2>>For example if I create a table = "EMPLOYEES" and in the table</FONT> <BR><FONT SIZE=3D2>>creation statement I do something like:</FONT> <BR><FONT SIZE=3D2>> create table = ...</FONT> <BR><FONT SIZE=3D2>> = constraint XXX primary key (EMP_ID) using index ...</FONT> <BR><FONT SIZE=3D2>>then later I create an index:</FONT> <BR><FONT SIZE=3D2>> create index YYY on EMPLOYEE = (EMP_ID) ...</FONT> <BR><FONT SIZE=3D2>>I know I have created two indexes (the first one = system-named</FONT> <BR><FONT SIZE=3D2>>and implicitly created and the second name YYY = and created</FONT> <BR><FONT SIZE=3D2>>explicitly) but do I really need the second = index YYY?</FONT> <BR><FONT SIZE=3D2>>It seems to me the YYY index is not really = needed? Can</FONT> <BR><FONT SIZE=3D2>>someone shed some light on this for me.</FONT> <BR><FONT SIZE=3D2>></FONT> <BR><FONT SIZE=3D2>>THANKS, Wayne</FONT> <BR><FONT SIZE=3D2>>McGillWL_at_navair.navy.mil</FONT> <BR><FONT SIZE=3D2>></FONT> <BR><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: Wayne McGill</FONT> <BR><FONT SIZE=3D2>> INET: = McGillWL_at_navair.navy.mil</FONT> <BR><FONT SIZE=3D2>></FONT> <BR><FONT SIZE=3D2>>Fat City Network Services -- = (858) 538-5051 FAX: (858) 538-5051</FONT> <BR><FONT SIZE=3D2>>San Diego, = California -- 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 from). You may</FONT> <BR><FONT SIZE=3D2>>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> INET: rharter_at_emc-inc.com</FONT> </P> <P><FONT SIZE=3D2>Fat City Network Services -- (858) = 538-5051 FAX: (858) 538-5051</FONT> <BR><FONT SIZE=3D2>San Diego, = California -- 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