Yes Dieter,
Shipment_Dt is used in the Where condition as well. And it uses the Partition elimination when the Condition commented below is removed from the query. I don't understand why Prod_Id has an impact of whether Partition should be used or not.
RETAIL_SHIPMENT has NUSI on PROD_ID and SHIPMENT_DT as well
Select
S.rtl_id,
mim.Retail_Extn.Key_Acct_id,
mim.Retail.Lvl_1_Mgmt_Acct_nm ChainName,
mim.Retail.Region_id,
mim.Retail.Section_Id,
mim.Retail.District_Id,
mim.Retail.Unit_Id,
mim.Retail.Territory_Id
FROM mim.RETAIL_SHIPMENT S
JOIN mim.Product P
ON S.Prod_ID = P.Prod_ID
and P.CATG_ID = 3
and P.Company_ID = 59
and P.Brand_Family_ID = 1489
/*and P.Prod_ID = 7683 */
And s.shipment_dt in ('2012-02-18','2013-02-16')
JOIN mim.RETAIL
ON S.RTL_ID = mim.Retail.RTL_ID
Inner Join mim.Retail_Extn
ON mim.Retail_Extn.RTL_ID = mim.Retail.RTL_ID
Group By 1,2,3,4,5,6,7,8
Thanks
↧