Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Plan changing after database restart
Hi all,
I have weird problem for one SQL query, which has
different execution plan before and after restarting
database.
Before restart, it use NESTED LOOP (ANTI JOIN) and
never completed (total logical reads > 1 billion).
After restart, it use HASH JOIN (RIGHT ANTI) and
complete in 2 minutes.
Optimizer environment was exactly same. Job was
running from sqlplus. There is no histogram also.
My concern is not about how to optimize this query, but more about WHY the execution plan is different before and after restarting db.
The only difference I aware was:
Before restart, most of the table and indexes were
already in memory.
But could it impact execution plan?
Your input is highly appreciated.
Best Regards,
tomi
Query:
view 'myview' is a complex view with union (all) of three subqueries.
![]() |
![]() |