Background
Recently my company upgraded from Oracle 11g to Exadata. All production objects and data were successfully migrated to the new system and were verified to be a 1:1 match between systems. Immediately after the first daily set of ETL processes were completed on our new system we discovered our reporting tables were significantly smaller than expected. Upon further investigation we discovered that a batch ID being added to LEFT OUTER joins were causing the problem where they had worked perfectly on 11g.
Question
Why would the following query be treated as a LEFT OUTER JOIN on 11g, but an INNER JOIN on Exadata?
SELECT
*
FROM DIM_CALL CALLS
LEFT OUTER JOIN FACT_ACTVY_MNGMT ACTVY_MNGMT
ON ACTVY_MNGMT.CALL_KEY = CALLS.CALL_KEY
AND ACTVY_MNGMT.BATCH_ID = 20141112
LEFT OUTER JOIN DIM_ACTVY ACTVY
ON ACTVY.ACTVY_KEY = ACTVY_MNGMT.ACTVY_KEY
AND ACTVY_MNGMT.BATCH_ID = 20141112
Update
It appears there was either a typo in the query used in the ETL process or the original developer just overlooked this case. If you look at the last join you'll notice that the join is on the ACTVY_KEY and BATCH_ID. The issue is that the BATCH_ID it's referencing is from the ACTVY_MNGMT table. The database essentially treats this as a WHERE clause, so any case in which CALL_KEY is NULL results in a failure.