这个sql为什么用地卡尔积?
select B.AREACODE as domain,D.ITEMTYPECODE,sum(A.SALEAMT) saleAmt
from serp01.mag_customer_sale_state_type A,
serp01.pub_area_code B,
serp01.pub_area_code_explode C,
serp01.pub_item_type_code D,
serp01.pub_item_type_explode E
where
a.enterprisecode = e.enterprisecode
and a.enterprisecode = d.enterprisecode
and a.enterprisecode = c.enterprisecode
and a.enterprisecode = b.enterprisecode
and A.EnterpriseCode = 'sygs'
and a.ITEMTYPECODE = e.ChildItemTypeCode
and e.parentitemtypecode = d.itemtypecode
and d.parentitemtypecode is null
and a.areacode = c.childareacode
and c.parentareacode = b.areacode
and b.parentareacode is null
and A.SALEDATE >= '2002/01/01'
明明5个表有4个连接条件,但是仍然有cartersian奇怪
group by B.AREACODE, D.ITEMTYPECODE
SELECT STATEMENT, GOAL = CHOOSE 1385 1 150
SORT GROUP BY 1385 1 150
NESTED LOOPS 1371 1 150
NESTED LOOPS 1371 50 6700
MERGE JOIN CARTESIAN 1371 993 122139
MERGE JOIN CARTESIAN 6 1 49
TABLE ACCESS FULL SERP01 PUB_AREA_CODE 5 1 28
SORT JOIN 1 1 21
INDEX RANGE SCAN SERP01 PUB_ITEM_TYPE_CODE_IDX_004 2 1 21
SORT JOIN 1370 993 73482
TABLE ACCESS FULL SERP01 MAG_CUSTOMER_SALE_STATE_TYPE 1365 993 73482
INDEX UNIQUE SCAN SERP01 PK47 3 33
INDEX UNIQUE SCAN SERP01 PK326 39 624
|