Help to optimize...
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


Help to optimize... Expand / Collapse
Author
Message
Posted 6/13/2008 10:44:57 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 8/31/2008 2:22:45 PM
Posts: 23, Visits: 99
the following code is taking about 9-10 hrs to comlpete and most of the times it's going out of spool .the final data inserted is in fig of 10 digits can anybody help me out how to optimize this code?dont consider collect stats as a soln as they are taken care of...

INSERT INTO TMP_T245235B
(
ACCT_ID,
CALL_USAGE_CHRGS,
SRVC_AND_EQUIP_CHRGS,
OTHR_CHRGS,
DT_ID
)
SELECT
TB.ACCT_ID,
(ZEROIFNULL(WRLN_BILL_CT_NET_AM) + ZEROIFNULL(WRLN_BILL_CT_GST_AM)) ,
(ZEROIFNULL(WRLN_BILL_RC_NET_AM) + ZEROIFNULL(WRLN_BILL_RC_GST_AM)) ,
(ZEROIFNULL(WRLN_BILL_NRC_GST_AM)+ ZEROIFNULL(WRLN_BILL_NRC_NET_AM)),
ABSD.DT_ID
FROM
${ETLVMDB}.TMP_T245215 TB
INNER JOIN
${VMDB}.AGG_BILL_SUBTN_DT ABSD
ON
TB.ACCT_ID = ABSD.ACCT_ID;
Post #11866
Posted 6/17/2008 3:00:55 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 6/26/2008 1:20:52 AM
Posts: 4, Visits: 8
Try case statements in place of zero if null functions
Post #11900
Posted 6/17/2008 11:03:28 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: PAC and SFT Members
Last Login: Today @ 10:56:35 AM
Posts: 298, Visits: 363
Really can't do much without more info, e.g. DDL and EXPLAIN.
Some obvious things to consider:
Is ACCT_NO the PI in any/all of the three tables? Is it unique? Do you get the right answer when the query finally does finish?
Post #11905
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 12:38pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.078. 11 queries. Compression Disabled.