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: HELP! Index Debate!

RE: HELP! Index Debate!

From: raju pa <raju_pa_24_at_yahoo.com>
Date: Thu, 31 Jul 2003 13:44:30 -0800
Message-ID: <F001.005C80AD.20030731134430@fatcity.com>


Related question would be : If in a composite index of 6 fields if the second column is null then would it be able to use the index for the rest of the four columns. How would it handle that. Assumption : First column is not null which would make it choose the index.  

IS it possible that something like that is happening here.  

To test your wise developer's claim that index is being used only for first column. You could create a simple one column index on PROD_ID and the query should pick that index up and run faster.  

No you do not need six separate indexes for this. I think your approach of one composite index with columns in WHERE clause is better. I mean how will six separate indexes help : Is the idea that it will look in one index then jump to another index and then to next one and get the row and so on?? Is it?? It will not. I think index entries have pointer to rowid of table not pointer to other indexes on the table. I donot have details here. MAybe some guru can clarify. Thanks  

"Jamadagni, Rajendra" <Rajendra.Jamadagni_at_espn.com> wrote: do you have corresponding indexes on referenced columns on T1-5 tables ??  

Raj



Rajendra dot Jamadagni at nospamespn dot com All Views expressed in this email are strictly personal. QOTD: Any clod can have facts, having an opinion is an art ! -----Original Message-----
Sent: Thursday, July 31, 2003 4:49 PM
To: Multiple recipients of list ORACLE-L

No answer for that.

-----Original Message-----
Sent: Thursday, July 31, 2003 3:44 PM
To: Multiple recipients of list ORACLE-L

How does one know that only one column is being used in an index and others are being ignored ... ?? This is new to me.

Raj



Rajendra dot Jamadagni at nospamespn dot com All Views expressed in this email are strictly personal. QOTD: Any clod can have facts, having an opinion is an art !

-----Original Message-----
Sent: Thursday, July 31, 2003 4:34 PM
To: Multiple recipients of list ORACLE-L

Please help resolve this dispute.
We have a query that runs over 5 hours. Sections of the query are listed below.

The table QOH_DAY_FACT table had only on index and that was on the TIME_ID column. I propose adding an index with PROD_ID, WHS_ID, LOT_ID, WHS_LOC, TIME_ID and QUALITY_ID. My test shows the runtime was reduced to about 1.5 hours.

The developer said all the columns in the index except PROD_ID were being ignored. He says there should be six separate indexes, one for each column before Oracle will use them.

Also, does the order of the columns in the index have to match the order of the columns in the WHERE CLAUS or is it more important to match the WHERE CLAUS to the data content (least number of rows first)?

I will be running more tests, but I would like some input on this if anyone has an opinion.

Thanks!
Ron

select T1."COUNTRY_NAME" "c1"
, T2."PRODTN_PROC_NAME" "c2"
, T2."PLANT_NAME" "c3"
, T1."WHS_NAME" "c4"
, T1."WHS_CMPLX_NAME" "c5"
, T3."WHS_LOC_NAME" "c6"
, T4."GRADE_DESC" "c7"
, T4."PACK_DESC" "c8"
, T5."FULL_DT" "c9"
, T6."QOH_MT" "c10".......

....from "DWMART"."DISTRIB_FCLTY_DIM" T1
, "DWMART"."MFG_FCLTY_DIM" T2
, "DWMART"."DISTRIB_LOC_DIM" T3
, "DWMART"."TIME_DIM" T5
, "DWMART"."QUALITY_DIM" T7
, "DWMART"."QOH_DAY_FACT" T6
, "DWMART"."PROD_DIM" T4

where T6."PROD_ID"=T4."PROD_ID"(+) 
   and T6."WHS_ID"=T1."WHS_ID" 
   and T6."LOT_ID"=T2."LOT_ID" 
   and T6."WHS_LOC_ID"=T3."WHS_LOC_ID" 

   and T6."TIME_ID"=T5."TIME_ID"
   and T6."QUALITY_ID"=T7."QUALITY_ID"
order by "c9" asc
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net 
-- 
Author: Smith, Ron L. 
  INET: rlsmith_at_kmg.com 

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com 
San Diego, California        -- Mailing list and web hosting services 
--------------------------------------------------------------------- 
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). 
********************************************************************This e-mail message is confidential, intended only for the named recipient(s) above and may contain information that is privileged, attorney work product or exempt from disclosure under applicable law. If you have received this message in error, or are not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000 and delete this e-mail message from your computer, Thank you.*********************************************************************2




---------------------------------
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: raju pa
  INET: raju_pa_24_at_yahoo.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
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).
Received on Thu Jul 31 2003 - 16:44:30 CDT

Original text of this message

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