Andjelko,

The particular optimisation that makes the “specific circumstance” unlikely is the one where Oracle reuses the result of the previous execution of the scalar subquery irrespective of the number of prior distinct values if the current value is the same as the previous value. For a hash join this would imply that the number of executions AFTER the join cannot be smaller than the number of executions BEFORE the join – but I don’t know if there are any cases where the optimisation doesn’t work so I’m hedging my bets on that.

]]>I’m not able to find out special case when “…the number of executions of the subquery to be significantly larger AFTER the hash join than BEFORE…”, since there is “internal optimization” when executing “sub-query”, number of execution is based on distinct value.

Do you have same example.

Thanks,

Andjelko