CREATETABLE table1 (
id INT,
name VARCHAR(20));CREATETABLE table2 (
id INT,
name VARCHAR(20));
The execution plan for the query using the inner join:
-- with inner join
EXPLAIN PLANFORSELECT*FROM table1 t1
INNERJOIN table2 t2 ON t1.id = t2.id;SELECT*FROMTABLE(DBMS_XPLAN.DISPLAY);-- 0 select statement-- 1 hash join (access("T1"."ID"="T2"."ID"))-- 2 table access full table1-- 3 table access full table2
And the execution plan for the query using a WHERE clause.
-- with where clause
EXPLAIN PLANFORSELECT*FROM table1 t1, table2 t2
WHERE t1.id = t2.id;SELECT*FROMTABLE(DBMS_XPLAN.DISPLAY);-- 0 select statement-- 1 hash join (access("T1"."ID"="T2"."ID"))-- 2 table access full table1-- 3 table access full table2