Originally posted by ADBA007
Query Plan in DB Instance 1:

Query Plan
------------------------------------------------------
SELECT STATEMENT Cost = 1180
HASH JOIN
TABLE ACCESS FULL Table_AAA
TABLE ACCESS FULL Table_BBB

Query Plan in DB Instance 2:

Query Plan
-----------------------
SELECT STATEMENT Cost = 1468
HASH JOIN
TABLE ACCESS FULL Table_BBB
TABLE ACCESS FULL Table_AAA


What difference it makes for an HASH JOIN operation if the table order are reveresed???.. Ofcourse if does a little bit for below 2 cases..

* Either of the tables is too small compared to other.
* Either of the tables involved have a limiting condition in the query which makes it virtually very small then other.

Well in your case it might not be the case, so oracle is thinking its immaterial if tab Table_AAA comes first or Table_BBB comes first ( For hashing the contents to be joined )..

Abhay.