Home » RDBMS Server » Performance Tuning » performance tuning PROBLEM
performance tuning PROBLEM [message #520096] Thu, 18 August 2011 10:22 Go to next message
shashank_kurasrediffmail
Messages: 63
Registered: July 2011
Location: hyderabad
Member

hi all,
I have problem with below query.
the query some times executing with in 1 minute and some times taking 3 minutes.


SELECT   SUBSTR (whse_code, 1, 1) || 'PL' "plant", SUBSTR (A.item_no,8) item_code,
         SUM (opnet1) opnet1, SUM (opnet1*CNF) opnet2,
         SUM (opqty1 - opnet1) oprej1, SUM ((opqty1 - opnet1)*CNF) oprej2,
         SUM (opqty1) opqty1, SUM (opqty1*CNF) opqty2, SUM (prodqty1) prodqty1,
         SUM (prodqty1*CNF) prodqty2, SUM (salesqty1 * -1) salesqty1,
         SUM ((salesqty1 * -1)*CNF) salesqty2, SUM (lossqty1) lossqty1,
         SUM (lossqty1*CNF) lossqty2, SUM (clnet1) clnet1, SUM (clnet1*CNF) clnet2,
         SUM (clqty1 - clnet1) clrej1, SUM ((clqty1 - clnet1)*CNF) clrej2,
         SUM (clqty1) clqty1, SUM (clqty1*CNF) clqty2, SUM (cl151) cl151,
         SUM (cl151*CNF) cl152, SUM (clnet1 - cl151) cm151,
         SUM ((clnet1 - cl151)*CNF) cm152
    FROM 
		( 			
            (SELECT   whse_code,
			           item_no,
			         item_id,
				     CASE WHEN lot_no NOT LIKE '%IPR%'  AND lot_no NOT LIKE '%WH%' 
				            AND (trans_date) < TO_DATE((:p_from_date ||'00:00:00'),'dd-mon-RRRR hh24-mi-ss' ) THEN (trans_qty) ELSE 0
				                                                                     END opnet1 ,
				    0 opnet2,
                    CASE WHEN (trans_date) < TO_DATE((:p_from_date ||'00:00:00'),'dd-mon-RRRR hh24-mi-ss' ) THEN  (trans_qty)  END opqty1,
                   0 opqty2,
                   0 prodqty1, 0 prodqty2, 0 salesqty1, 0 salesqty2,
                   0 lossqty1, 0 lossqty2,
				   CASE WHEN lot_no NOT LIKE '%IPR%'  AND lot_no NOT LIKE '%WH%' THEN  (trans_qty) ELSE 0 END clnet1 ,
				    0 clnet2,
				    (trans_qty)  clqty1,
                   0 clqty2, 0 cl151, 0 cl152
			  FROM 				   				   
				  ( SELECT  LOT.lot_no,
				            lot.item_id,
						     trx.whse_code,
							 mst.item_no, 
							 mst.item_desc1, 
							 trx.trans_um,
							 trx.trans_date,
							 trx.trans_qty, 
							 trx.trans_um2 
				    FROM 
                      ic_tran_vw1 trx,
                      ic_item_mst mst,
                      ic_lots_mst lot
               WHERE 
			       mst.item_id = trx.item_id
                   AND mst.item_id = lot.item_id
                   AND lot.lot_id = trx.lot_id
                   AND trx.whse_code BETWEEN NVL (:p_from_whsecode, trx.whse_code)
                                      AND NVL (:p_to_whsecode, trx.whse_code)
                    AND trx.completed_ind = '1'
                    AND (SUBSTR (trx.whse_code, 2, 2) = 'FG'  OR   SUBSTR (trx.whse_code, 2, 2)='WP')
                    AND trx.whse_code NOT LIKE '5%' 
                    AND trx.doc_type NOT LIKE 'TRNI'
                -- AND lot.lot_no LIKE '%' || :p_lot_no || '%'
	                AND ((SUBSTR( lot.LOT_NO,LENGTH(lot.LOT_NO),1)='S' AND :P_LOT_NO='S') OR (SUBSTR( lot.LOT_NO,LENGTH(lot.LOT_NO),1)='V' 
			        AND :P_LOT_NO='V') OR (lot.LOT_NO=lot.LOT_NO AND :p_LOT_NO IS NULL) )
                    AND mst.item_no BETWEEN NVL (:p_from_item_no, mst.item_no)
                                    AND NVL (:p_to_item_no, mst.item_no)
                                      ---- Change the item code over here
                    AND   mst.item_no LIKE 'A-FG-1%'
			    	AND (trans_date) <= TO_DATE((:p_to_date ||'23:59:59'),'dd-mon-RRRR hh24-mi-ss' ) 
				 )  																				                  
       UNION ALL		  		  			
		   SELECT   whse_code, item_no, item_id, 0 opqty1, 0 opqty2, 0 opnet1, 0 opnet2,
                  ( prodqty1), 0 prodqty2, 0 salesqty1, 0 salesqty2,
                  (lossqty1), 0 lossqty2, 0 clnet1, 0 clnet2, 0 clqty1,
                   0 clqty2, 0  cl151,
                   0 cl152
				   FROM 
			(
			   SELECT 
			        TRX. whse_code,
					 MST.item_no,
					 lot.item_id,              
                    CASE WHEN routing_no NOT  LIKE '%SALVAGING%'    THEN  (trans_qty) ELSE 0  END PRODQTY1,                                     
				    CASE WHEN routing_no LIKE '%SALVAGING%'    THEN  (trans_qty) ELSE 0 END  LOSSQTY1 				                    			
			  FROM 				     
                       ic_tran_pnd trx,
                      ic_item_mst mst,
                      ic_lots_mst lot,
                      gme_batch_header_vw bat
               WHERE mst.item_id = trx.item_id
                    AND mst.item_id = lot.item_id
                    AND lot.lot_id = trx.lot_id
         --         AND lot.lot_no LIKE '%' || :p_lot_no || '%'
		 	       AND ((SUBSTR( lot.LOT_NO,LENGTH(lot.LOT_NO),1)='S' AND :P_LOT_NO='S') OR (SUBSTR( lot.LOT_NO,LENGTH(lot.LOT_NO),1)='V' 
				                                                  AND :P_LOT_NO='V') OR (lot.LOT_NO=lot.LOT_NO AND :p_LOT_NO IS NULL) )
                   AND trx.whse_code BETWEEN NVL (:p_from_whsecode, trx.whse_code)
                                     AND NVL (:p_to_whsecode, trx.whse_code)
                    AND trx.completed_ind = '1'
                    AND trx.delete_mark=0
                    AND trx.whse_code NOT LIKE '5%'
                    AND trx.doc_type = 'PROD'
                    AND SUBSTR (trx.whse_code, 2, 2) IN ('FG', 'WP')         
                    AND bat.batch_id = trx.doc_id
                    AND mst.item_no LIKE 'A-FG-1%'
			        AND  mst.item_no BETWEEN NVL (:p_from_item_no, mst.item_no)
                    AND NVL (:p_to_item_no, mst.item_no)
		             AND (trx.trans_date) BETWEEN TO_DATE((:p_from_date ||'00:00:00'),'dd-mon-RRRR hh24-mi-ss' )
				                        AND TO_DATE((:p_to_date ||'23:59:59'),'dd-mon-RRRR hh24-mi-ss' ) 
             --  AND TRUNC(trx.trans_date) BETWEEN :p_from_date AND :p_to_date 			
			  )             				  								   				      
          UNION ALL		
		     SELECT   trx.whse_code, mst.item_no,lot.item_id,
                   0 opqty1, 0 opqty2, 0 opnet1, 0 opnet2,
                   0 prodqty1, 0 prodqty2,  0 salesqty1,
                   0 salesqty2,
                   0 lossqty1, 0 lossqty2, 0 clnet1, 0 clnet2, 0 clqty1,
                   0 clqty2,(trx.trans_qty) cl151, 0 cl152
		      FROM 			
                   ic_tran_pnd trx,
                   ic_item_mst mst,
                   ic_lots_mst lot,
                   gme_batch_header_vw bat
              WHERE mst.item_id = trx.item_id
                   AND mst.item_id = lot.item_id
                   AND lot.lot_id = trx.lot_id
         --        AND lot.lot_no LIKE '%' || :p_lot_no || '%'
		 	       AND ((SUBSTR( lot.LOT_NO,LENGTH(lot.LOT_NO),1)='S' AND :P_LOT_NO='S') OR (SUBSTR( lot.LOT_NO,LENGTH(lot.LOT_NO),1)='V' 
				                                                AND :P_LOT_NO='V') OR (lot.LOT_NO=lot.LOT_NO AND :p_LOT_NO IS NULL) )
               	   AND trx.whse_code BETWEEN NVL (:p_from_whsecode, trx.whse_code)
                                     AND NVL (:p_to_whsecode, trx.whse_code)
             	   AND trx.completed_ind = '1'
            	   AND trx.delete_mark=0
              	   AND trx.whse_code NOT LIKE '5%'
             	   AND trx.doc_type = 'PROD'
             	   AND SUBSTR (trx.whse_code, 2, 2) IN ('FG', 'WP')         
             	   AND bat.batch_id = trx.doc_id
                   AND mst.item_no LIKE 'A-FG-1%'
			       AND  mst.item_no BETWEEN NVL (:p_from_item_no, mst.item_no)
                                   AND NVL (:p_to_item_no, mst.item_no)
               --  AND TRUNC(trx.trans_date) BETWEEN :p_from_date AND :p_to_date 			 
			       AND  lot.lot_no NOT LIKE '%IPR%'   
			       AND lot.lot_no NOT LIKE '%WH%'
			       AND bat.routing_no NOT LIKE '%SALVAGING%'
                   AND (trx.trans_date)  BETWEEN TO_DATE((:p_to_date||'00:00:00'),'dd-mon-RRRR hh24:mi:ss' )-15 
                                                            AND    TO_DATE((:p_to_date ||'23:59:59'),'dd-mon-RRRR hh24-mi-ss' )						              				  								   				      
          UNION ALL		  		  		    		  
	     SELECT   trx.whse_code, mst.item_no,lot.item_id,
                   0 opqty1, 0 opqty2, 0 opnet1, 0 opnet2,
                   0 prodqty1, 0 prodqty2,  (trx.trans_qty) salesqty1,
                   0 salesqty2,
                   0 lossqty1, 0 lossqty2, 0 clnet1, 0 clnet2, 0 clqty1,
                   0 clqty2, 0 cl151, 0 cl152
              FROM 
			       ic_tran_pnd trx,
                   ic_item_mst mst,
                   ic_lots_mst lot
             WHERE 
			       mst.item_id = trx.item_id
                   AND mst.item_id = lot.item_id
                   AND lot.lot_id = trx.lot_id
           --     AND lot.lot_no LIKE '%' || :p_lot_no || '%'
		   	      AND ((SUBSTR( lot.LOT_NO,LENGTH(lot.LOT_NO),1)='S' AND :P_LOT_NO='S') OR (SUBSTR( lot.LOT_NO,LENGTH(lot.LOT_NO),1)='V' 
				                                                   AND :P_LOT_NO='V') OR (lot.LOT_NO=lot.LOT_NO AND :p_LOT_NO IS NULL) )
                  AND trx.whse_code BETWEEN NVL (:p_from_whsecode, trx.whse_code)
                                     AND NVL (:p_to_whsecode, trx.whse_code)
                   AND trx.completed_ind = '1'
                   AND trx.delete_mark=0
                   AND SUBSTR (trx.whse_code, 2, 2) IN  ('FG','WP')
                   AND trx.whse_code NOT LIKE '5%'
                   AND trx.doc_type IN ('OMSO', 'PORC')
                   AND mst.item_no BETWEEN NVL (:p_from_item_no, mst.item_no)
                                   AND NVL (:p_to_item_no, mst.item_no)
                    AND mst.item_no LIKE 'A-FG-1-%'
                    AND (trx.trans_date) BETWEEN TO_DATE((:p_from_date ||'00:00:00'),'dd-mon-RRRR hh24-mi-ss' )
					            AND TO_DATE((:p_to_date ||'23:59:59'),'dd-mon-RRRR hh24-mi-ss' )
                                             ) 				   
				     )A,VIS_ITM_CTG_CNV_MST B 
  WHERE 
        A.ITEM_NO=B.ITEM_NO			
		AND a.item_id=b.item_id 
GROUP BY SUBSTR (whse_code, 1, 1) || 'PL', SUBSTR (A.item_no, 8)
--HAVING SUM (  opnet1 + opqty1 + prodqty1 + (salesqty1 * -1) + lossqty1 + clnet1 + clqty1 ) <> 0
ORDER BY 1, 2

              		   
	


Re: performance tuning PROBLEM [message #520097 is a reply to message #520096] Thu, 18 August 2011 10:23 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
For any peformances question, please read http://www.orafaq.com/forum/mv/msg/84315/433888/102589/#msg_433888 and post the required information.

Regards
Michel
Re: performance tuning PROBLEM [message #520098 is a reply to message #520097] Thu, 18 August 2011 10:27 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>the query some times executing with in 1 minute and some times taking 3 minutes.
are EXPLAIN PLAN the same for both cases?

where does SQL_TRACE show time is being spent?
Re: performance tuning PROBLEM [message #520099 is a reply to message #520097] Thu, 18 August 2011 10:29 Go to previous messageGo to next message
shashank_kurasrediffmail
Messages: 63
Registered: July 2011
Location: hyderabad
Member

hi michel ,
thanks for reply
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
 
and am running this in TOAD 



I think the problem with case ?
case will effect the performance?
Re: performance tuning PROBLEM [message #520100 is a reply to message #520099] Thu, 18 August 2011 10:32 Go to previous messageGo to next message
shashank_kurasrediffmail
Messages: 63
Registered: July 2011
Location: hyderabad
Member

the below execution plan for 2:44:00 (time)

SELECT STATEMENT Optimizer=ALL_ROWS (Cost=174 Card=1 Bytes=161)
  SORT (AGGREGATE)
    HASH JOIN (Cost=174 Card=3 Bytes=483)
      VIEW OF VIS_ITM_CTG_CNV_MST (VIEW) (Cost=49 Card=3 Bytes=144)
        HASH (UNIQUE) (Cost=49 Card=3 Bytes=708)
          NESTED LOOPS (OUTER) (Cost=48 Card=3 Bytes=708)
            NESTED LOOPS (Cost=24 Card=1 Bytes=215)
              NESTED LOOPS (Cost=23 Card=1 Bytes=197)
                NESTED LOOPS (Cost=22 Card=1 Bytes=172)
                  NESTED LOOPS (Cost=20 Card=1 Bytes=136)
                    NESTED LOOPS (Cost=19 Card=1 Bytes=126)
                      NESTED LOOPS (Cost=17 Card=1 Bytes=106)
                        NESTED LOOPS (Cost=17 Card=1 Bytes=99)
                          TABLE ACCESS (BY INDEX ROWID) OF MTL_SYSTEM_ITEMS_B (TABLE) (Cost=16 Card=1 Bytes=67)
                            INDEX (RANGE SCAN) OF MTL_SYSTEM_ITEMS_B_N1 (INDEX) (Cost=15 Card=1)
                          INDEX (RANGE SCAN) OF IDX$$_514C0004 (INDEX) (Cost=1 Card=1 Bytes=32)
                        INDEX (UNIQUE SCAN) OF IC_ITEM_MST_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=7)
                      INDEX (RANGE SCAN) OF MTL_ITEM_CATEGORIES_U1 (INDEX (UNIQUE)) (Cost=2 Card=1 Bytes=20)
                    TABLE ACCESS (BY INDEX ROWID) OF MTL_CATEGORY_SETS_B (TABLE) (Cost=1 Card=1 Bytes=10)
                      INDEX (UNIQUE SCAN) OF MTL_CATEGORY_SETS_B_U1 (INDEX (UNIQUE)) (Cost=0 Card=1)
                  INDEX (RANGE SCAN) OF FND_LOOKUP_VALUES_U1 (INDEX (UNIQUE)) (Cost=2 Card=1 Bytes=36)
                TABLE ACCESS (BY INDEX ROWID) OF MTL_CATEGORY_SETS_TL (TABLE) (Cost=1 Card=1 Bytes=25)
                  INDEX (UNIQUE SCAN) OF MTL_CATEGORY_SETS_TL_U1 (INDEX (UNIQUE)) (Cost=0 Card=1)
              TABLE ACCESS (BY INDEX ROWID) OF MTL_CATEGORIES_B (TABLE) (Cost=1 Card=1 Bytes=18)
                INDEX (UNIQUE SCAN) OF MTL_CATEGORIES_B_U1 (INDEX (UNIQUE)) (Cost=0 Card=1)
            TABLE ACCESS (BY INDEX ROWID) OF IC_ITEM_CNV (TABLE) (Cost=24 Card=96 Bytes=2016)
              INDEX (RANGE SCAN) OF IC_ITEM_CNV_U1 (INDEX (UNIQUE)) (Cost=3 Card=267)
      VIEW (Cost=124 Card=6 Bytes=678)
        UNION-ALL
          NESTED LOOPS (Cost=67 Card=1 Bytes=90)
            NESTED LOOPS (Cost=51 Card=1 Bytes=58)
              NESTED LOOPS (Cost=2 Card=1 Bytes=33)
                INDEX (RANGE SCAN) OF IDX$$_514C0004 (INDEX) (Cost=2 Card=1 Bytes=26)
                INDEX (UNIQUE SCAN) OF IC_ITEM_MST_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=7)
              TABLE ACCESS (BY INDEX ROWID) OF IC_LOTS_MST (TABLE) (Cost=49 Card=15 Bytes=375)
                INDEX (RANGE SCAN) OF IC_LOTS_MST_PK (INDEX (UNIQUE)) (Cost=3 Card=303)
            VIEW OF IC_TRAN_VW1 (VIEW) (Cost=16 Card=1 Bytes=32)
              UNION ALL PUSHED PREDICATE
                CONCATENATION
                  FILTER
                    TABLE ACCESS (BY INDEX ROWID) OF IC_TRAN_PND (TABLE) (Cost=4 Card=1 Bytes=36)
                      INDEX (RANGE SCAN) OF IDX$$_76690010 (INDEX) (Cost=3 Card=1)
                  FILTER
                    TABLE ACCESS (BY INDEX ROWID) OF IC_TRAN_PND (TABLE) (Cost=4 Card=1 Bytes=36)
                      INDEX (RANGE SCAN) OF IDX$$_76690010 (INDEX) (Cost=3 Card=1)
                CONCATENATION
                  FILTER
                    TABLE ACCESS (BY INDEX ROWID) OF IC_TRAN_CMP (TABLE) (Cost=4 Card=1 Bytes=32)
                      INDEX (RANGE SCAN) OF IDX$$_76690011 (INDEX) (Cost=3 Card=1)
                  FILTER
                    TABLE ACCESS (BY INDEX ROWID) OF IC_TRAN_CMP (TABLE) (Cost=4 Card=1 Bytes=32)
                      INDEX (RANGE SCAN) OF IDX$$_76690011 (INDEX) (Cost=3 Card=1)
          FILTER
            NESTED LOOPS (OUTER) (Cost=13 Card=1 Bytes=172)
              NESTED LOOPS (Cost=11 Card=1 Bytes=152)
                NESTED LOOPS (Cost=11 Card=1 Bytes=145)
                  NESTED LOOPS (Cost=9 Card=1 Bytes=120)
                    NESTED LOOPS (Cost=9 Card=1 Bytes=112)
                      NESTED LOOPS (Cost=9 Card=1 Bytes=107)
                        NESTED LOOPS (Cost=9 Card=1 Bytes=99)
                          NESTED LOOPS (Cost=9 Card=1 Bytes=94)
                            NESTED LOOPS (Cost=8 Card=1 Bytes=84)
                              NESTED LOOPS (Cost=7 Card=1 Bytes=67)
                                INDEX (RANGE SCAN) OF IDX$$_514C0004 (INDEX) (Cost=2 Card=1 Bytes=26)
                                TABLE ACCESS (BY INDEX ROWID) OF IC_TRAN_PND (TABLE) (Cost=5 Card=1 Bytes=41)
                                  INDEX (RANGE SCAN) OF IC_TRAN_PNDI6 (INDEX) (Cost=4 Card=1)
                              TABLE ACCESS (BY INDEX ROWID) OF GME_BATCH_HEADER (TABLE) (Cost=1 Card=1 Bytes=17)
                                INDEX (UNIQUE SCAN) OF GME_BATCH_HEADER_PK (INDEX (UNIQUE)) (Cost=0 Card=1)
                            TABLE ACCESS (BY INDEX ROWID) OF GMD_RECIPE_VALIDITY_RULES (TABLE) (Cost=1 Card=1 Bytes=10)
                              INDEX (UNIQUE SCAN) OF GMD_RECIPE_VALIDITY_RULES_PK (INDEX (UNIQUE)) (Cost=0 Card=1)
                          INDEX (UNIQUE SCAN) OF GMD_RECIPES_B_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=5)
                        INDEX (UNIQUE SCAN) OF GMD_RECIPES_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=8)
                      INDEX (UNIQUE SCAN) OF FM_FORM_MST_B_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=5)
                    INDEX (UNIQUE SCAN) OF FM_FORM_MST_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=8)
                  TABLE ACCESS (BY INDEX ROWID) OF IC_LOTS_MST (TABLE) (Cost=2 Card=1 Bytes=25)
                    INDEX (UNIQUE SCAN) OF IC_LOTS_MST_PK (INDEX (UNIQUE)) (Cost=1 Card=1)
                INDEX (UNIQUE SCAN) OF IC_ITEM_MST_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=7)
              VIEW PUSHED PREDICATE OF GMD_ROUTINGS_VL (VIEW) (Cost=2 Card=1 Bytes=20)
                NESTED LOOPS (Cost=2 Card=1 Bytes=29)
                  TABLE ACCESS (BY INDEX ROWID) OF GMD_ROUTINGS_B (TABLE) (Cost=2 Card=1 Bytes=22)
                    INDEX (UNIQUE SCAN) OF GMD_ROUTINGS_B_PK (INDEX (UNIQUE)) (Cost=1 Card=1)
                  INDEX (UNIQUE SCAN) OF GMD_ROUTING_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=7)
          CONCATENATION
            FILTER
              NESTED LOOPS (Cost=12 Card=1 Bytes=181)
                NESTED LOOPS (Cost=12 Card=1 Bytes=174)
                  NESTED LOOPS (Cost=10 Card=1 Bytes=149)
                    NESTED LOOPS (Cost=10 Card=1 Bytes=141)
                      NESTED LOOPS (Cost=10 Card=1 Bytes=136)
                        NESTED LOOPS (Cost=10 Card=1 Bytes=129)
                          NESTED LOOPS (Cost=9 Card=1 Bytes=107)
                            NESTED LOOPS (Cost=9 Card=1 Bytes=99)
                              NESTED LOOPS (Cost=9 Card=1 Bytes=94)
                                NESTED LOOPS (Cost=8 Card=1 Bytes=84)
                                  NESTED LOOPS (Cost=7 Card=1 Bytes=67)
                                    INDEX (RANGE SCAN) OF IDX$$_514C0004 (INDEX) (Cost=2 Card=1 Bytes=26)
                                    TABLE ACCESS (BY INDEX ROWID) OF IC_TRAN_PND (TABLE) (Cost=5 Card=1 Bytes=41)
                                      INDEX (RANGE SCAN) OF IC_TRAN_PNDI6 (INDEX) (Cost=4 Card=1)
                                  TABLE ACCESS (BY INDEX ROWID) OF GME_BATCH_HEADER (TABLE) (Cost=1 Card=1 Bytes=17)
                                    INDEX (UNIQUE SCAN) OF GME_BATCH_HEADER_PK (INDEX (UNIQUE)) (Cost=0 Card=1)
                                TABLE ACCESS (BY INDEX ROWID) OF GMD_RECIPE_VALIDITY_RULES (TABLE) (Cost=1 Card=1 Bytes=10)
                                  INDEX (UNIQUE SCAN) OF GMD_RECIPE_VALIDITY_RULES_PK (INDEX (UNIQUE)) (Cost=0 Card=1)
                              INDEX (UNIQUE SCAN) OF GMD_RECIPES_B_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=5)
                            INDEX (UNIQUE SCAN) OF GMD_RECIPES_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=8)
                          TABLE ACCESS (BY INDEX ROWID) OF GMD_ROUTINGS_B (TABLE) (Cost=1 Card=1 Bytes=22)
                            INDEX (UNIQUE SCAN) OF GMD_ROUTINGS_B_PK (INDEX (UNIQUE)) (Cost=0 Card=1)
                        INDEX (UNIQUE SCAN) OF GMD_ROUTING_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=7)
                      INDEX (UNIQUE SCAN) OF FM_FORM_MST_B_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=5)
                    INDEX (UNIQUE SCAN) OF FM_FORM_MST_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=8)
                  TABLE ACCESS (BY INDEX ROWID) OF IC_LOTS_MST (TABLE) (Cost=2 Card=1 Bytes=25)
                    INDEX (UNIQUE SCAN) OF IC_LOTS_MST_PK (INDEX (UNIQUE)) (Cost=1 Card=1)
                INDEX (UNIQUE SCAN) OF IC_ITEM_MST_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=7)
            FILTER
              NESTED LOOPS (Cost=13 Card=1 Bytes=181)
                NESTED LOOPS (Cost=13 Card=1 Bytes=174)
                  NESTED LOOPS (Cost=11 Card=1 Bytes=149)
                    NESTED LOOPS (Cost=11 Card=1 Bytes=141)
                      NESTED LOOPS (Cost=11 Card=1 Bytes=136)
                        NESTED LOOPS (Cost=11 Card=1 Bytes=129)
                          NESTED LOOPS (Cost=10 Card=1 Bytes=107)
                            NESTED LOOPS (Cost=10 Card=1 Bytes=99)
                              NESTED LOOPS (Cost=10 Card=1 Bytes=94)
                                NESTED LOOPS (Cost=9 Card=1 Bytes=84)
                                  NESTED LOOPS (Cost=8 Card=1 Bytes=67)
                                    INDEX (RANGE SCAN) OF IDX$$_514C0004 (INDEX) (Cost=3 Card=1 Bytes=26)
                                    TABLE ACCESS (BY INDEX ROWID) OF IC_TRAN_PND (TABLE) (Cost=5 Card=1 Bytes=41)
                                      INDEX (RANGE SCAN) OF IC_TRAN_PNDI6 (INDEX) (Cost=4 Card=1)
                                  TABLE ACCESS (BY INDEX ROWID) OF GME_BATCH_HEADER (TABLE) (Cost=1 Card=1 Bytes=17)
                                    INDEX (UNIQUE SCAN) OF GME_BATCH_HEADER_PK (INDEX (UNIQUE)) (Cost=0 Card=1)
                                TABLE ACCESS (BY INDEX ROWID) OF GMD_RECIPE_VALIDITY_RULES (TABLE) (Cost=1 Card=1 Bytes=10)
                                  INDEX (UNIQUE SCAN) OF GMD_RECIPE_VALIDITY_RULES_PK (INDEX (UNIQUE)) (Cost=0 Card=1)
                              INDEX (UNIQUE SCAN) OF GMD_RECIPES_B_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=5)
                            INDEX (UNIQUE SCAN) OF GMD_RECIPES_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=8)
                          TABLE ACCESS (BY INDEX ROWID) OF GMD_ROUTINGS_B (TABLE) (Cost=1 Card=1 Bytes=22)
                            INDEX (UNIQUE SCAN) OF GMD_ROUTINGS_B_PK (INDEX (UNIQUE)) (Cost=0 Card=1)
                        INDEX (UNIQUE SCAN) OF GMD_ROUTING_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=7)
                      INDEX (UNIQUE SCAN) OF FM_FORM_MST_B_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=5)
                    INDEX (UNIQUE SCAN) OF FM_FORM_MST_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=8)
                  TABLE ACCESS (BY INDEX ROWID) OF IC_LOTS_MST (TABLE) (Cost=2 Card=1 Bytes=25)
                    INDEX (UNIQUE SCAN) OF IC_LOTS_MST_PK (INDEX (UNIQUE)) (Cost=1 Card=1)
                INDEX (UNIQUE SCAN) OF IC_ITEM_MST_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=7)
          CONCATENATION
            FILTER
              NESTED LOOPS
                NESTED LOOPS (Cost=9 Card=1 Bytes=94)
                  NESTED LOOPS (Cost=7 Card=1 Bytes=69)
                    NESTED LOOPS (Cost=2 Card=1 Bytes=33)
                      INDEX (RANGE SCAN) OF IDX$$_514C0004 (INDEX) (Cost=2 Card=1 Bytes=26)
                      INDEX (UNIQUE SCAN) OF IC_ITEM_MST_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=7)
                    INLIST ITERATOR
                      TABLE ACCESS (BY INDEX ROWID) OF IC_TRAN_PND (TABLE) (Cost=5 Card=1 Bytes=36)
                        INDEX (RANGE SCAN) OF IC_TRAN_PNDI6 (INDEX) (Cost=4 Card=1)
                  INDEX (UNIQUE SCAN) OF IC_LOTS_MST_PK (INDEX (UNIQUE)) (Cost=1 Card=1)
                TABLE ACCESS (BY INDEX ROWID) OF IC_LOTS_MST (TABLE) (Cost=2 Card=1 Bytes=25)
            FILTER
              NESTED LOOPS
                NESTED LOOPS (Cost=10 Card=1 Bytes=94)
                  NESTED LOOPS (Cost=8 Card=1 Bytes=69)
                    NESTED LOOPS (Cost=3 Card=1 Bytes=33)
                      INDEX (RANGE SCAN) OF IDX$$_514C0004 (INDEX) (Cost=3 Card=1 Bytes=26)
                      INDEX (UNIQUE SCAN) OF IC_ITEM_MST_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=7)
                    INLIST ITERATOR
                      TABLE ACCESS (BY INDEX ROWID) OF IC_TRAN_PND (TABLE) (Cost=5 Card=1 Bytes=36)
                        INDEX (RANGE SCAN) OF IC_TRAN_PNDI6 (INDEX) (Cost=4 Card=1)
                  INDEX (UNIQUE SCAN) OF IC_LOTS_MST_PK (INDEX (UNIQUE)) (Cost=1 Card=1)
                TABLE ACCESS (BY INDEX ROWID) OF IC_LOTS_MST (TABLE) (Cost=2 Card=1 Bytes=25)


the below one is for 57 sec and all input for the bind variables is same for both plans
SELECT STATEMENT Optimizer=ALL_ROWS (Cost=175 Card=1 Bytes=146)
  SORT (GROUP BY) (Cost=175 Card=1 Bytes=146)
    HASH JOIN (Cost=174 Card=3 Bytes=438)
      VIEW OF VIS_ITM_CTG_CNV_MST (VIEW) (Cost=49 Card=3 Bytes=102)
        HASH (UNIQUE) (Cost=49 Card=3 Bytes=708)
          NESTED LOOPS (OUTER) (Cost=48 Card=3 Bytes=708)
            NESTED LOOPS (Cost=24 Card=1 Bytes=215)
              NESTED LOOPS (Cost=23 Card=1 Bytes=197)
                NESTED LOOPS (Cost=22 Card=1 Bytes=172)
                  NESTED LOOPS (Cost=20 Card=1 Bytes=136)
                    NESTED LOOPS (Cost=19 Card=1 Bytes=126)
                      NESTED LOOPS (Cost=17 Card=1 Bytes=106)
                        NESTED LOOPS (Cost=17 Card=1 Bytes=99)
                          TABLE ACCESS (BY INDEX ROWID) OF MTL_SYSTEM_ITEMS_B (TABLE) (Cost=16 Card=1 Bytes=67)
                            INDEX (RANGE SCAN) OF MTL_SYSTEM_ITEMS_B_N1 (INDEX) (Cost=15 Card=1)
                          INDEX (RANGE SCAN) OF IDX$$_514C0004 (INDEX) (Cost=1 Card=1 Bytes=32)
                        INDEX (UNIQUE SCAN) OF IC_ITEM_MST_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=7)
                      INDEX (RANGE SCAN) OF MTL_ITEM_CATEGORIES_U1 (INDEX (UNIQUE)) (Cost=2 Card=1 Bytes=20)
                    TABLE ACCESS (BY INDEX ROWID) OF MTL_CATEGORY_SETS_B (TABLE) (Cost=1 Card=1 Bytes=10)
                      INDEX (UNIQUE SCAN) OF MTL_CATEGORY_SETS_B_U1 (INDEX (UNIQUE)) (Cost=0 Card=1)
                  INDEX (RANGE SCAN) OF FND_LOOKUP_VALUES_U1 (INDEX (UNIQUE)) (Cost=2 Card=1 Bytes=36)
                TABLE ACCESS (BY INDEX ROWID) OF MTL_CATEGORY_SETS_TL (TABLE) (Cost=1 Card=1 Bytes=25)
                  INDEX (UNIQUE SCAN) OF MTL_CATEGORY_SETS_TL_U1 (INDEX (UNIQUE)) (Cost=0 Card=1)
              TABLE ACCESS (BY INDEX ROWID) OF MTL_CATEGORIES_B (TABLE) (Cost=1 Card=1 Bytes=18)
                INDEX (UNIQUE SCAN) OF MTL_CATEGORIES_B_U1 (INDEX (UNIQUE)) (Cost=0 Card=1)
            TABLE ACCESS (BY INDEX ROWID) OF IC_ITEM_CNV (TABLE) (Cost=24 Card=96 Bytes=2016)
              INDEX (RANGE SCAN) OF IC_ITEM_CNV_U1 (INDEX (UNIQUE)) (Cost=3 Card=267)
      VIEW (Cost=124 Card=6 Bytes=672)
        UNION-ALL
          NESTED LOOPS (Cost=67 Card=1 Bytes=94)
            NESTED LOOPS (Cost=51 Card=1 Bytes=58)
              NESTED LOOPS (Cost=2 Card=1 Bytes=33)
                INDEX (RANGE SCAN) OF IDX$$_514C0004 (INDEX) (Cost=2 Card=1 Bytes=26)
                INDEX (UNIQUE SCAN) OF IC_ITEM_MST_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=7)
              TABLE ACCESS (BY INDEX ROWID) OF IC_LOTS_MST (TABLE) (Cost=49 Card=15 Bytes=375)
                INDEX (RANGE SCAN) OF IC_LOTS_MST_PK (INDEX (UNIQUE)) (Cost=3 Card=303)
            VIEW OF IC_TRAN_VW1 (VIEW) (Cost=16 Card=1 Bytes=36)
              UNION ALL PUSHED PREDICATE
                CONCATENATION
                  FILTER
                    TABLE ACCESS (BY INDEX ROWID) OF IC_TRAN_PND (TABLE) (Cost=4 Card=1 Bytes=36)
                      INDEX (RANGE SCAN) OF IDX$$_76690010 (INDEX) (Cost=3 Card=1)
                  FILTER
                    TABLE ACCESS (BY INDEX ROWID) OF IC_TRAN_PND (TABLE) (Cost=4 Card=1 Bytes=36)
                      INDEX (RANGE SCAN) OF IDX$$_76690010 (INDEX) (Cost=3 Card=1)
                CONCATENATION
                  FILTER
                    TABLE ACCESS (BY INDEX ROWID) OF IC_TRAN_CMP (TABLE) (Cost=4 Card=1 Bytes=32)
                      INDEX (RANGE SCAN) OF IDX$$_76690011 (INDEX) (Cost=3 Card=1)
                  FILTER
                    TABLE ACCESS (BY INDEX ROWID) OF IC_TRAN_CMP (TABLE) (Cost=4 Card=1 Bytes=32)
                      INDEX (RANGE SCAN) OF IDX$$_76690011 (INDEX) (Cost=3 Card=1)
          FILTER
            NESTED LOOPS (OUTER) (Cost=13 Card=1 Bytes=172)
              NESTED LOOPS (Cost=11 Card=1 Bytes=152)
                NESTED LOOPS (Cost=11 Card=1 Bytes=145)
                  NESTED LOOPS (Cost=9 Card=1 Bytes=120)
                    NESTED LOOPS (Cost=9 Card=1 Bytes=112)
                      NESTED LOOPS (Cost=9 Card=1 Bytes=107)
                        NESTED LOOPS (Cost=9 Card=1 Bytes=99)
                          NESTED LOOPS (Cost=9 Card=1 Bytes=94)
                            NESTED LOOPS (Cost=8 Card=1 Bytes=84)
                              NESTED LOOPS (Cost=7 Card=1 Bytes=67)
                                INDEX (RANGE SCAN) OF IDX$$_514C0004 (INDEX) (Cost=2 Card=1 Bytes=26)
                                TABLE ACCESS (BY INDEX ROWID) OF IC_TRAN_PND (TABLE) (Cost=5 Card=1 Bytes=41)
                                  INDEX (RANGE SCAN) OF IC_TRAN_PNDI6 (INDEX) (Cost=4 Card=1)
                              TABLE ACCESS (BY INDEX ROWID) OF GME_BATCH_HEADER (TABLE) (Cost=1 Card=1 Bytes=17)
                                INDEX (UNIQUE SCAN) OF GME_BATCH_HEADER_PK (INDEX (UNIQUE)) (Cost=0 Card=1)
                            TABLE ACCESS (BY INDEX ROWID) OF GMD_RECIPE_VALIDITY_RULES (TABLE) (Cost=1 Card=1 Bytes=10)
                              INDEX (UNIQUE SCAN) OF GMD_RECIPE_VALIDITY_RULES_PK (INDEX (UNIQUE)) (Cost=0 Card=1)
                          INDEX (UNIQUE SCAN) OF GMD_RECIPES_B_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=5)
                        INDEX (UNIQUE SCAN) OF GMD_RECIPES_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=8)
                      INDEX (UNIQUE SCAN) OF FM_FORM_MST_B_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=5)
                    INDEX (UNIQUE SCAN) OF FM_FORM_MST_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=8)
                  TABLE ACCESS (BY INDEX ROWID) OF IC_LOTS_MST (TABLE) (Cost=2 Card=1 Bytes=25)
                    INDEX (UNIQUE SCAN) OF IC_LOTS_MST_PK (INDEX (UNIQUE)) (Cost=1 Card=1)
                INDEX (UNIQUE SCAN) OF IC_ITEM_MST_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=7)
              VIEW PUSHED PREDICATE OF GMD_ROUTINGS_VL (VIEW) (Cost=2 Card=1 Bytes=20)
                NESTED LOOPS (Cost=2 Card=1 Bytes=29)
                  TABLE ACCESS (BY INDEX ROWID) OF GMD_ROUTINGS_B (TABLE) (Cost=2 Card=1 Bytes=22)
                    INDEX (UNIQUE SCAN) OF GMD_ROUTINGS_B_PK (INDEX (UNIQUE)) (Cost=1 Card=1)
                  INDEX (UNIQUE SCAN) OF GMD_ROUTING_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=7)
          CONCATENATION
            FILTER
              NESTED LOOPS (Cost=12 Card=1 Bytes=181)
                NESTED LOOPS (Cost=12 Card=1 Bytes=174)
                  NESTED LOOPS (Cost=10 Card=1 Bytes=149)
                    NESTED LOOPS (Cost=10 Card=1 Bytes=141)
                      NESTED LOOPS (Cost=10 Card=1 Bytes=136)
                        NESTED LOOPS (Cost=10 Card=1 Bytes=129)
                          NESTED LOOPS (Cost=9 Card=1 Bytes=107)
                            NESTED LOOPS (Cost=9 Card=1 Bytes=99)
                              NESTED LOOPS (Cost=9 Card=1 Bytes=94)
                                NESTED LOOPS (Cost=8 Card=1 Bytes=84)
                                  NESTED LOOPS (Cost=7 Card=1 Bytes=67)
                                    INDEX (RANGE SCAN) OF IDX$$_514C0004 (INDEX) (Cost=2 Card=1 Bytes=26)
                                    TABLE ACCESS (BY INDEX ROWID) OF IC_TRAN_PND (TABLE) (Cost=5 Card=1 Bytes=41)
                                      INDEX (RANGE SCAN) OF IC_TRAN_PNDI6 (INDEX) (Cost=4 Card=1)
                                  TABLE ACCESS (BY INDEX ROWID) OF GME_BATCH_HEADER (TABLE) (Cost=1 Card=1 Bytes=17)
                                    INDEX (UNIQUE SCAN) OF GME_BATCH_HEADER_PK (INDEX (UNIQUE)) (Cost=0 Card=1)
                                TABLE ACCESS (BY INDEX ROWID) OF GMD_RECIPE_VALIDITY_RULES (TABLE) (Cost=1 Card=1 Bytes=10)
                                  INDEX (UNIQUE SCAN) OF GMD_RECIPE_VALIDITY_RULES_PK (INDEX (UNIQUE)) (Cost=0 Card=1)
                              INDEX (UNIQUE SCAN) OF GMD_RECIPES_B_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=5)
                            INDEX (UNIQUE SCAN) OF GMD_RECIPES_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=8)
                          TABLE ACCESS (BY INDEX ROWID) OF GMD_ROUTINGS_B (TABLE) (Cost=1 Card=1 Bytes=22)
                            INDEX (UNIQUE SCAN) OF GMD_ROUTINGS_B_PK (INDEX (UNIQUE)) (Cost=0 Card=1)
                        INDEX (UNIQUE SCAN) OF GMD_ROUTING_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=7)
                      INDEX (UNIQUE SCAN) OF FM_FORM_MST_B_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=5)
                    INDEX (UNIQUE SCAN) OF FM_FORM_MST_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=8)
                  TABLE ACCESS (BY INDEX ROWID) OF IC_LOTS_MST (TABLE) (Cost=2 Card=1 Bytes=25)
                    INDEX (UNIQUE SCAN) OF IC_LOTS_MST_PK (INDEX (UNIQUE)) (Cost=1 Card=1)
                INDEX (UNIQUE SCAN) OF IC_ITEM_MST_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=7)
            FILTER
              NESTED LOOPS (Cost=13 Card=1 Bytes=181)
                NESTED LOOPS (Cost=13 Card=1 Bytes=174)
                  NESTED LOOPS (Cost=11 Card=1 Bytes=149)
                    NESTED LOOPS (Cost=11 Card=1 Bytes=141)
                      NESTED LOOPS (Cost=11 Card=1 Bytes=136)
                        NESTED LOOPS (Cost=11 Card=1 Bytes=129)
                          NESTED LOOPS (Cost=10 Card=1 Bytes=107)
                            NESTED LOOPS (Cost=10 Card=1 Bytes=99)
                              NESTED LOOPS (Cost=10 Card=1 Bytes=94)
                                NESTED LOOPS (Cost=9 Card=1 Bytes=84)
                                  NESTED LOOPS (Cost=8 Card=1 Bytes=67)
                                    INDEX (RANGE SCAN) OF IDX$$_514C0004 (INDEX) (Cost=3 Card=1 Bytes=26)
                                    TABLE ACCESS (BY INDEX ROWID) OF IC_TRAN_PND (TABLE) (Cost=5 Card=1 Bytes=41)
                                      INDEX (RANGE SCAN) OF IC_TRAN_PNDI6 (INDEX) (Cost=4 Card=1)
                                  TABLE ACCESS (BY INDEX ROWID) OF GME_BATCH_HEADER (TABLE) (Cost=1 Card=1 Bytes=17)
                                    INDEX (UNIQUE SCAN) OF GME_BATCH_HEADER_PK (INDEX (UNIQUE)) (Cost=0 Card=1)
                                TABLE ACCESS (BY INDEX ROWID) OF GMD_RECIPE_VALIDITY_RULES (TABLE) (Cost=1 Card=1 Bytes=10)
                                  INDEX (UNIQUE SCAN) OF GMD_RECIPE_VALIDITY_RULES_PK (INDEX (UNIQUE)) (Cost=0 Card=1)
                              INDEX (UNIQUE SCAN) OF GMD_RECIPES_B_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=5)
                            INDEX (UNIQUE SCAN) OF GMD_RECIPES_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=8)
                          TABLE ACCESS (BY INDEX ROWID) OF GMD_ROUTINGS_B (TABLE) (Cost=1 Card=1 Bytes=22)
                            INDEX (UNIQUE SCAN) OF GMD_ROUTINGS_B_PK (INDEX (UNIQUE)) (Cost=0 Card=1)
                        INDEX (UNIQUE SCAN) OF GMD_ROUTING_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=7)
                      INDEX (UNIQUE SCAN) OF FM_FORM_MST_B_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=5)
                    INDEX (UNIQUE SCAN) OF FM_FORM_MST_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=8)
                  TABLE ACCESS (BY INDEX ROWID) OF IC_LOTS_MST (TABLE) (Cost=2 Card=1 Bytes=25)
                    INDEX (UNIQUE SCAN) OF IC_LOTS_MST_PK (INDEX (UNIQUE)) (Cost=1 Card=1)
                INDEX (UNIQUE SCAN) OF IC_ITEM_MST_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=7)
          CONCATENATION
            FILTER
              NESTED LOOPS
                NESTED LOOPS (Cost=9 Card=1 Bytes=94)
                  NESTED LOOPS (Cost=7 Card=1 Bytes=69)
                    NESTED LOOPS (Cost=2 Card=1 Bytes=33)
                      INDEX (RANGE SCAN) OF IDX$$_514C0004 (INDEX) (Cost=2 Card=1 Bytes=26)
                      INDEX (UNIQUE SCAN) OF IC_ITEM_MST_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=7)
                    INLIST ITERATOR
                      TABLE ACCESS (BY INDEX ROWID) OF IC_TRAN_PND (TABLE) (Cost=5 Card=1 Bytes=36)
                        INDEX (RANGE SCAN) OF IC_TRAN_PNDI6 (INDEX) (Cost=4 Card=1)
                  INDEX (UNIQUE SCAN) OF IC_LOTS_MST_PK (INDEX (UNIQUE)) (Cost=1 Card=1)
                TABLE ACCESS (BY INDEX ROWID) OF IC_LOTS_MST (TABLE) (Cost=2 Card=1 Bytes=25)
            FILTER
              NESTED LOOPS
                NESTED LOOPS (Cost=10 Card=1 Bytes=94)
                  NESTED LOOPS (Cost=8 Card=1 Bytes=69)
                    NESTED LOOPS (Cost=3 Card=1 Bytes=33)
                      INDEX (RANGE SCAN) OF IDX$$_514C0004 (INDEX) (Cost=3 Card=1 Bytes=26)
                      INDEX (UNIQUE SCAN) OF IC_ITEM_MST_TL_PK (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=7)
                    INLIST ITERATOR
                      TABLE ACCESS (BY INDEX ROWID) OF IC_TRAN_PND (TABLE) (Cost=5 Card=1 Bytes=36)
                        INDEX (RANGE SCAN) OF IC_TRAN_PNDI6 (INDEX) (Cost=4 Card=1)
                  INDEX (UNIQUE SCAN) OF IC_LOTS_MST_PK (INDEX (UNIQUE)) (Cost=1 Card=1)
                TABLE ACCESS (BY INDEX ROWID) OF IC_LOTS_MST (TABLE) (Cost=2 Card=1 Bytes=25)

Re: performance tuning PROBLEM [message #520103 is a reply to message #520100] Thu, 18 August 2011 10:47 Go to previous messageGo to next message
shashank_kurasrediffmail
Messages: 63
Registered: July 2011
Location: hyderabad
Member

hi blackswan thanks for reply .
I posted the execution plans of both and both are same.

I think the problem is with case?
will case effects the performance?
Re: performance tuning PROBLEM [message #520105 is a reply to message #520103] Thu, 18 August 2011 10:58 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
diff indicates the plans are actually slightly different

so why the differences?

bcm@bcm-laptop:~$ diff min2.plan sec57.plan 
1,4c1,4
< SELECT STATEMENT Optimizer=ALL_ROWS (Cost=174 Card=1 Bytes=161)
<   SORT (AGGREGATE)
<     HASH JOIN (Cost=174 Card=3 Bytes=483)
<       VIEW OF VIS_ITM_CTG_CNV_MST (VIEW) (Cost=49 Card=3 Bytes=144)
---
> SELECT STATEMENT Optimizer=ALL_ROWS (Cost=175 Card=1 Bytes=146)
>   SORT (GROUP BY) (Cost=175 Card=1 Bytes=146)
>     HASH JOIN (Cost=174 Card=3 Bytes=438)
>       VIEW OF VIS_ITM_CTG_CNV_MST (VIEW) (Cost=49 Card=3 Bytes=102)
28c28
<       VIEW (Cost=124 Card=6 Bytes=678)
---
>       VIEW (Cost=124 Card=6 Bytes=672)
30c30
<           NESTED LOOPS (Cost=67 Card=1 Bytes=90)
---
>           NESTED LOOPS (Cost=67 Card=1 Bytes=94)
37c37
<             VIEW OF IC_TRAN_VW1 (VIEW) (Cost=16 Card=1 Bytes=32)
---
>             VIEW OF IC_TRAN_VW1 (VIEW) (Cost=16 Card=1 Bytes=36)
167a168
> 
bcm@bcm-laptop:~$ 

Re: performance tuning PROBLEM [message #520108 is a reply to message #520105] Thu, 18 August 2011 11:12 Go to previous messageGo to next message
shashank_kurasrediffmail
Messages: 63
Registered: July 2011
Location: hyderabad
Member

this is because of many case statements ?

I didnt do any modifications for both and

once again am checking the explain plan ..
Re: performance tuning PROBLEM [message #520109 is a reply to message #520108] Thu, 18 August 2011 11:17 Go to previous message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
from where I sit, different results imply that SOMETHING changed.
We don't have your table or data so we can't do anything with posted query (other than stare at it)
Any solution must originate with you & you alone.
Previous Topic: Need help with tuning
Next Topic: Speed up this SQL
Goto Forum:
  


Current Time: Fri Nov 22 01:40:52 CST 2024