|
|
Archives of the TeradataForum
Message Posted: Thu, 10 Jun 2004 @ 15:08:05 GMT
Subj: | | Performance Improvement on this Query without Collecting Statistics |
|
From: | | Kambhoji, Naveen Ram Prasanna |
Hi Group,
Is there any other way to improve Performance of the below query other than COLLECTING STATISTICS .....There are around 180 Million rows in
DAILY_SPEND and 882 rows in DATE table....
INSERT INTO BCWK_SPEND (BCWeekID, MarketID, MediaSubTypeID, DaypartCode, companyID,
AdvertiserID, DistributorID, ProgramID, CreativeID, ClassificationID, AttributeID, Spend, Units)
SELECT dt.BCWeekID, s.MarketID, s.MediaSubTypeID, s.DaypartCode, s.companyID,
s.AdvertiserID, s.DistributorID, s.ProgramID, s.CreativeID, s.ClassificationID, s.AttributeID,
SUM(s.Spend), SUM(s.Units)
FROM DAILY_SPEND s
JOIN DATE dt on dt.DateID = s.DateID
GROUP BY dt.BCWeekID, s.MarketID, s.MediaSubTypeID, s.DaypartCode, s.companyID, s.AdvertiserID,
s.DistributorID, s.ProgramID, s.CreativeID, s.ClassificationID, s.AttributeID;
Thanx!
Prasanna
| |