Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: 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_01BFBA78.62585A24
Content-Type: text/plain;
charset="ISO-8859-1"
Chris,
You hit the nail on the head! Does anyone know if this is true about indexes/PK/FK?
Val
-----Original Message-----
From: Chris Griffith [mailto:Chris.Griffith_at_dstm.com]
Sent: Tuesday, May 09, 2000 5:32 PM
To: Multiple recipients of list ORACLE-L
Subject: RE: indexes
Good question, I've wondered the same thing. Add to that question if you have a Primary key with 3 columns A,B,C in the PK and have a foreign key on column A,B will the PK index be used for A,B to prevent the table lock on the referenced table.
-----Original Message-----
Sent: Tuesday, May 09, 2000 4:37 PM
To: Multiple recipients of list ORACLE-L
Is it safe to say that Oracle will use the composite index on A,B,C if A is a foreign key. What I'm getting at is that I don't need a separate index on column A which is a foreign key if I already have the composite index A,B,C
Thanks for all the help!
Val
-----Original Message-----
Sent: Tuesday, May 09, 2000 12:35 PM
To: Multiple recipients of list ORACLE-L
Valerie,
I believe it can use the A column of the index, but not the C column, so depending on how selective A is, this may or may not be a good thing.
Gary
Gary Kirsh
Next Extent, Inc.
-----Original Message-----
Sent: Tuesday, May 09, 2000 11:10 AM
To: Multiple recipients of list ORACLE-L
I know this issue has been discussed before but I can't find the answer in my list archives.
If you have a composite index on a table consisting of columns A,B,C in that order, will the index be used if I have a query/where clause on columns A and C?
I know that it will if I query on A alone or A,B or A,B,C but I can't find documentation about A and C (no B)
Thanks in advance!
Val
Valerie H. Webber
Management Systems Designers, Inc
Valerie.H.Webber_at_m1.irs.gov
704-569-1002 x107
-- Author: Chris Griffith INET: Chris.Griffith_at_dstm.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_01BFBA78.62585A24 Content-Type: text/html; charset="ISO-8859-1"Received on Wed May 10 2000 - 07:07:49 CDT
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2650.12">
<TITLE>RE: indexes</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Chris,</FONT>
</P>
<P><FONT SIZE=2>You hit the nail on the head! Does anyone know if this is true about indexes/PK/FK?</FONT>
</P>
<P><FONT SIZE=2>Val</FONT>
</P>
<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Chris Griffith [<A HREF="mailto:Chris.Griffith_at_dstm.com">mailto:Chris.Griffith_at_dstm.com</A>]</FONT>
<BR><FONT SIZE=2>Sent: Tuesday, May 09, 2000 5:32 PM</FONT>
<BR><FONT SIZE=2>To: Multiple recipients of list ORACLE-L</FONT>
<BR><FONT SIZE=2>Subject: RE: indexes</FONT>
</P>
<BR>
<P><FONT SIZE=2>Good question, I've wondered the same thing. Add to that question if you</FONT>
<BR><FONT SIZE=2>have a Primary key with 3 columns A,B,C in the PK and have a foreign key on</FONT>
<BR><FONT SIZE=2>column A,B will the PK index be used for A,B to prevent the table lock on</FONT>
<BR><FONT SIZE=2>the referenced table.</FONT>
</P>
<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>Sent: Tuesday, May 09, 2000 4:37 PM</FONT>
<BR><FONT SIZE=2>To: Multiple recipients of list ORACLE-L</FONT>
</P>
<BR>
<P><FONT SIZE=2>Is it safe to say that Oracle will use the composite index on A,B,C if A is</FONT>
<BR><FONT SIZE=2>a foreign key. What I'm getting at is that I don't need a separate index on</FONT>
<BR><FONT SIZE=2>column A which is a foreign key if I already have the composite index A,B,C</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>Thanks for all the help!</FONT>
<BR><FONT SIZE=2>Val</FONT>
</P>
<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>Sent: Tuesday, May 09, 2000 12:35 PM</FONT>
<BR><FONT SIZE=2>To: Multiple recipients of list ORACLE-L</FONT>
</P>
<BR>
<P><FONT SIZE=2>Valerie,</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>I believe it can use the A column of the index, but not the C column, so</FONT>
<BR><FONT SIZE=2>depending on how selective A is, this may or may not be a good thing.</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>Gary</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>Gary Kirsh</FONT>
<BR><FONT SIZE=2>Next Extent, Inc.</FONT>
</P>
<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>Sent: Tuesday, May 09, 2000 11:10 AM</FONT>
<BR><FONT SIZE=2>To: Multiple recipients of list ORACLE-L</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=2>I know this issue has been discussed before but I can't find the answer in</FONT>
<BR><FONT SIZE=2>my list archives. </FONT>
</P>
<P><FONT SIZE=2>If you have a composite index on a table consisting of columns A,B,C in that</FONT>
<BR><FONT SIZE=2>order, will the index be used if I have a query/where clause on columns A</FONT>
<BR><FONT SIZE=2>and C?</FONT>
</P>
<P><FONT SIZE=2>I know that it will if I query on A alone or A,B or A,B,C but I can't find</FONT>
<BR><FONT SIZE=2>documentation about A and C (no B) </FONT>
</P>
<P><FONT SIZE=2>Thanks in advance! </FONT>
<BR><FONT SIZE=2>Val </FONT>
</P>
<P><FONT SIZE=2>Valerie H. Webber</FONT>
<BR><FONT SIZE=2>Management Systems Designers, Inc</FONT>
<BR><FONT SIZE=2>Valerie.H.Webber_at_m1.irs.gov</FONT>
<BR><FONT SIZE=2>704-569-1002 x107 </FONT>
</P>
<BR>
<P><FONT SIZE=2>-- </FONT>
<BR><FONT SIZE=2>Author: Chris Griffith</FONT>
<BR><FONT SIZE=2> INET: Chris.Griffith_at_dstm.com</FONT>
</P>
<P><FONT SIZE=2>Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051</FONT>
<BR><FONT SIZE=2>San Diego, California -- Public Internet access / Mailing Lists</FONT>
<BR><FONT SIZE=2>--------------------------------------------------------------------</FONT>
<BR><FONT SIZE=2>To REMOVE yourself from this mailing list, send an E-Mail message</FONT>
<BR><FONT SIZE=2>to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in</FONT>
<BR><FONT SIZE=2>the message BODY, include a line containing: UNSUB ORACLE-L</FONT>
<BR><FONT SIZE=2>(or the name of mailing list you want to be removed from). You may</FONT>
![]() |
![]() |