Why would the second query use the same plan?

You work on an online transaction processing (OLTP) database in which the SALES table has
10,000 rows but only four distinct products are sold.
View the Exhibit named HIST to check the distribution of values in the table and the histograms on the table.

View the Exhibits named QUERY-1 and QUERY-2 that show details in the V$SQL view for the
queries executed on the SALES table.

You check the plan table and notice that both the queries that executed on the SALES table used
index range scan. The second query retrieved most of the rows in the table but used index range scan.

Why would the second query use the same plan?

You work on an online transaction processing (OLTP) database in which the SALES table has
10,000 rows but only four distinct products are sold.
View the Exhibit named HIST to check the distribution of values in the table and the histograms on the table.

View the Exhibits named QUERY-1 and QUERY-2 that show details in the V$SQL view for the
queries executed on the SALES table.

You check the plan table and notice that both the queries that executed on the SALES table used
index range scan. The second query retrieved most of the rows in the table but used index range scan.

Why would the second query use the same plan?

A.
because the plan wasbind aware

B.
because the bind peeking never happened

C.
because the OPEN_CURSORS parameter is set to a very low value

D.
because the optimizer did not consider selectivity due to the use of bind variables



Leave a Reply 1

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


L. Zhu

L. Zhu

A is wrong. bind-aware is N
B is wrong. bind peeking happened
C is wrong.
D is right.

So D is correct