Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 07 Jan 2011 @ 13:18:17 GMT


     
  <Prev Next>  
<<First
<Prev
Next> Last>>  


Subj:   Tune the query - giving spool space error
 
From:   Anomy Anom

<-- Anonymously Posted: Thursday, January 7, 2011 08:00 -->

Hi guys,

I do have the below query, in end its giving error of Spool space issue.

We have stats collected on the PI of the table.

If someone can help, I would appreciate very much on how to tune the below query, it would be great.

     SELECT
     P.ORG_BPTY_ID
     P.BPTY_ID
     FROM
     Pln P
     INNER JOIN
     ZLZ_Pln_Ln SPL
     ON P.PLN_ID = SPL.ZLZ_PLN_ID
     AND P.PLN_RVSN_DT = SPL.PLN_RVSN_DT
     AND P.ORG_BPTY_ID = 2
     LEFT JOIN
     ZLZ_Pln_Ln_Amnt SPLA
     ON SPLA.ZLZ_PLN_LN_NUM = SPL.ZLZ_PLN_LN_NUM
     AND SPLA.ZLZ_PLN_ID= SPL.ZLZ_PLN_ID
     AND SPLA.PLN_RVSN_DT = SPL.PLN_RVSN_DT
     AND SPLA.ZLZ_Pln_Ln_Dt = SPL.ZLZ_PLN_LN_DT
     LEFT JOIN
     ZLZ_PLN_LN_ITM_ASSN SPLIA
     ON SPL.ZLZ_PLN_LN_NUM = SPLIA.ZLZ_PLN_LN_NUM
     AND SPL.ZLZ_PLN_ID= SPLIA.ZLZ_PLN_ID
     AND SPL.PLN_RVSN_DT = SPLIA.PLN_RVSN_DT
     LEFT JOIN
     ITM ITM
     ON ITM.ITM_ID = SPLIA.ITM_ID
     LEFT JOIN
     ZLZ_PLN_LN_PRTY_ASSN SPLPA
     ON SPL.ZLZ_PLN_LN_NUM = SPLPA.ZLZ_PLN_LN_NUM
     AND SPL.ZLZ_PLN_ID= SPLPA.ZLZ_PLN_ID
     AND SPL.PLN_RVSN_DT = SPLPA.PLN_RVSN_DT
     LEFT JOIN
     ZRTY ZRTY
     ON ZRTY.BPTY_ID = SPLPA.BPTY_ID
     AND ZRTY.SRC_PRTY_TYP_CD = 'CSTMR'
     LEFT JOIN
     ZLZ_LN_AMNT_TYP SLAT
     ON SPLA.SL_LN_AMT_TYP_NUM  = SLAT.SL_LN_AMT_TYP_NUM
     AND  P.ORG_BPTY_ID      = SLAT.ORG_BPTY_ID
     LEFT JOIN
     LN_AMT_TYP_HIER_GRP_ASSN LATHGA
     ON SLAT.SL_LN_AMT_TYP_NUM = LATHGA.LN_AMT_TYP_NUM
     AND SLAT.ORG_BPTY_ID      = LATHGA.ORG_BPTY_ID

Thanks



     
  <Prev Next>  
<<First
<Prev
Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023