Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Query Rewriting. - response (4) by Huzain

$
0
0

Hi Dieter,
Could you please look into my problem, I am new to this site. need your help.
We have problem with a query in which the aggregation stpes take more time to complete as given below the explain plan
We do an all-AMPs SUM step to aggregate from Spool 6 (Last Use) by
     way of an all-rows scan , grouping by field1 (
     PDWRKCDR.A.CALL_START_DT ,PDWRKCDR.A.ACCS_METH_ID
     ,PDWRKCDR.A.ACCS_METH_VAL ,PDWRKCDR.A.CCB_SBSCRPN_ID
     ,PDWRKCDR.A.TELP_TYPE).  Aggregate Intermediate Results are
     computed globally, then placed in Spool 13.  The aggregate spool
     file will not be cached in memory.  The size of Spool 13 is
     estimated with low confidence to be 25,734,269 rows (
     41,226,298,938 bytes).  The estimated time for this step is 1 hour
     and 1 minute.
 
  8) Finally, we send out an END TRANSACTION step to all AMPs involved
     in processing the request.
  -> The contents of Spool 4 are sent back to the user as the result of
     statement 1.  The total estimated time is 1 hour and 3 minutes.
 
The stats were stealed but it the data is not changing so , i have recollect but there come no difference in reponse time.
 
but relate to sum aggregate in select because this query have many sum aggregate and “case when” condition (around 320 condition and sql 2000+ record) and very big data (VOL_CDR_PRE is around 740 million record). 
 
How would i optimized the aggregation in order to optimized the query.
 
Thanks


Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>