Which SQL plan baseline would be used if the SQL query in exhibit1 is executed again

View the Exhibit exhibit1 to examine the series of SQL commands and parameter settings.
View the Exhibit exhibit2 to examine the plans available in the SQL plan baseline.
The first plan (in red) is created when OPTIMIZER_MODE is set to ALL_ROWS and the second plan (in blue) is created when OPTIMIZER_MODE is set to FIRST_ROWS.
Which SQL plan baseline would be used if the SQL query in exhibit1 is executed again when the value of OPTIMIZER_MODE is set to FIRST_ROWS?
Exhibit 1 (exhibit):
Exhibit 2 (exhibit):

View the Exhibit exhibit1 to examine the series of SQL commands and parameter settings.

View the Exhibit exhibit2 to examine the plans available in the SQL plan baseline.

The first plan (in red) is created when OPTIMIZER_MODE is set to ALL_ROWS and the second plan (in blue) is created when OPTIMIZER_MODE is set to FIRST_ROWS.

Which SQL plan baseline would be used if the SQL query in exhibit1 is executed again when the value of OPTIMIZER_MODE is set to FIRST_ROWS?

A.
the second plan, because it is a fixed plan

B.
the first plan, because it is an accepted plan

C.
the second plan, because it is the latest generated plan in FIRST_ROW mode

D.
A new plan, because the second plan in FIRST_ROW mode is not an accepted plan



Leave a Reply 3

Your email address will not be published. Required fields are marked *


plumbum

plumbum

The correct answer is A

jiri

jiri

In my opinion option A is incorrect because second plan can NOT be used because it is NOT accepted.

vasya

vasya

A correct
If a fixed SQL plan baseline also contains non-fixed plans, the optimizer will give preference to fixed plans over non-fixed ones. This means that the optimizer will pick the fixed plan with the least cost even though a non-fixed plan may have an even lower cost. If none of the fixed plans is reproducible, then the optimizer will pick the best non-fixed plan.