When MERGE JOIN CARTESIAN Is Healthy

Occasionally safe when one side is genuinely guaranteed to return 0 or 1 row (for example a single-row config lookup).

When MERGE JOIN CARTESIAN Becomes a Production Bottleneck

Almost always a severe bug (missing JOIN predicate) or catastrophic cardinality lie where Oracle guessed E-Rows=1 on a table that actually returned thousands of rows.

DBMS_XPLAN Tuning Checklist

  • Verify every table in the FROM clause has an explicit ON join predicate.
  • Inspect E-Rows vs A-Rows on both children; stale stats showing E-Rows=1 frequently trick the CBO into Cartesian joins.
  • Check BUFFER SORT underneath for massive Used-Tmp disk spills.

Before (Slow Pattern)

SELECT i.id, c.iso_code FROM fact_invoices i, dim_currency c WHERE c.active_flag = 'Y';

After (Tuned Pattern)

-- Add missing join predicate with ANSI JOIN syntax
SELECT i.id, c.iso_code FROM fact_invoices i JOIN dim_currency c ON c.id = i.currency_id WHERE c.active_flag = 'Y';