Join to table pa_expenditure_items_all using orig_transaction_reference
When I do an expalin on this query, I get a Merge Join - Cartesian Product however the cost is not high (17). Does anyone have any suggestions.
SELECT SUM((ei.denom_raw_cost))
,SUM(abs(ei.denom_raw_cost))
FROM xx_pa_cost_trx_in_stg xpct,
apps.pa_expenditures_all e,
apps.pa_expenditure_items_all ei
WHERE xpct.orig_transaction_referenc = ei.orig_transaction_reference