September 19, 2007 at 3:22 pm
Please help me in giving the suggestions for tuning the below query. The execution time is 12 min.
Below is the record count of each table :
FTProductUsage
- 35737259
FTContractValue - 1980410
FTContractRole - 130644561
VDTJobStartDT - 5480
LKCostCenter - 243
select a14.JSD_Month_ID Month_ID,
max(a14.JSD_MonthYr_DS) MonthYr_DS,
a13.CostCenter costcenter_DS,
max(a15.CostCenterName) CostCenterName,
a15.RegionID RegionID,
max(a15.RegionName) RegionName,
a15.ChannelID ChannelID,
max(a15.ChannelName) ChannelName,
sum(a11.Quantity) WJXBFS1
from FTProductUsage a11
join FTContractValue a12
on (a11.Account_ID = a12.Account_ID and
a11.Contract_KY = a12.Contract_KY)
join FTContractRole a13
on (a12.Contract_ID = a13.Contract_ID)
join VDTJobStartDT a14
on (a11.JobStartDT_KY = a14.JobStartDT_KY)
join LKCostCenter a15
on (a13.CostCenter = a15.CostCenter)
where (a11.ProductCapability in ('JobListing')
and a11.UsedFlg in (1)
and a11.HybridJobFlg in (0)
and a14.JSD_Month_ID = 200708
and a13.YearMonth = 200708
and a13.RoleType in ('PRIMREP'))
group by a14.JSD_Month_ID,
a13.CostCenter,
a15.RegionID,
a15.ChannelID
September 19, 2007 at 3:48 pm
This thread is being worked here:
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=360&messageid=400533
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply