I have a query that I am trying to run against teradata. I received an email stating that my query was using too much of the CPU resources and to please modify before proceeding.
My question is, why is my query so cumbersome? Is there anything you can see in the structure of my query that sticks out as terribly inefficient?
FROM DLY_LINE_ACTIVITY_PPLAN_V AS A
SUBS_SUM_FACT_V AS B
HR_EMPLOYEE_V AS C
HR_EMPLOYEE_V AS DIR
A.ACTIVITY_DT >= '2012-06-28'
--AND A.ACTIVITY_DT <= '2012-11-19'
AND C.EMP_AREA_CD LIKE 'WE'
AND A.PPLAN_CD_CURR IN ('86489', '86491', '86492',
'86494', '86495', '86496', '86497', '86498', '86499', '86500', '86501',
'86502', '86487', '86489', '86504', '86505', '86506', '86507', '86508',
'86509', '86510', '86511', '86512')
Explain plan of the query and DDL / Indexes of the table referenced will help in understanding what could be going wrong...