Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How "deterministic" are EXPLAIN PLAN results?
Spam_at_DefinitiveSolutions.com (Larry Leonard) wrote in message news:<27270a53.0304090254.6c48b3f_at_posting.google.com>...
> I have a question about Oracle's "explain plan". Let's set aside the
> subject of "stored outlines" for the moment, and assume that I'm
> talking about only one database (that is, I'm not talking about
> anything *across* databases).
>
> Let's say I have a SELECT statment, and I'm considering using one of
> two hints (call them HINTA and HINTB, to avoid clouding the issue).
> When I run the SELECT with HINTA, I can get the "explain plan" for it
> from my PLAN_TABLE. Likewise for running the SELECT using HINTB. So
> far so good.
>
> My question is this. If the "explain plan" for these two queries is
> *exactly* the same, does that mean that Oracle will *definitely* use
> the same "statement execution plan" for them? Or are there ever
> circumstances in which two SELECT statements with identical "explain
> plans" will be executed with different "statement execution plans"?
>
> TIA.
It's even possible that the same select statement will be executed
with different plans in different time.
Actually, if plans are the same in EXPLAIN PLAN, they are most probably the same during statements execution, if you didn't analyze tables or indexes between EXPLAIN PLAN and execution. But, for example, statement within PL/SQL block may have different plan than the same statement executed directly. Received on Wed Apr 09 2003 - 10:21:08 CDT
![]() |
![]() |