Which three statements are true about SQL plan directives?

Which three statements are true about SQL plan directives?

Which three statements are true about SQL plan directives?

A.
They are tied to a specific statement or SQL ID.

B.
They instruct the maintenance job to collect missing statistics or perform dynamic sampling to
generate a more optimal plan.

C.
They are used to gather only missing statistics.

D.
They are created for a query expression where statistics are missing or the cardinality
estimates by the optimizer are incorrect.

E.
They instruct the optimizer to create only column group statistics.

F.
Improve plan accuracy by persisting both compilation and execution statistics in the SYSAUX
tablespace.

Explanation:
During SQL execution, if a cardinality misestimate occurs, then the database
creates SQL plan directives. During SQL compilation, the optimizer examines the query
corresponding to the directive to determine whether missing extensions or histograms exist (D).
The optimizer records any missing extensions. Subsequent DBMS_STATS calls collect statistics
for the extensions.
The optimizer uses dynamic sampling whenever it does not have sufficient statistics
corresponding to the directive. (B, not C)
E: Currently, the optimizer monitors only column groups. The optimizer does not create an
extension on expressions.
Incorrect:
Not A: SQL plan directives are not tied to a specific SQL statement or SQL ID.
Note:
* A SQL plan directive is additional information and instructions that the optimizer can use to
generate a more optimal plan. For example, a SQL plan directive can instruct the optimizer to
record a missing extension.



Leave a Reply 13

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


Ledeboer, Jeroen

Ledeboer, Jeroen

Directives can be monitored in DBA_SQL_PLAN_DIR_OBJECTS. SQL plan directives improve plan accuracy by persisting both compilation and execution stats in the SYSAUX TBS, allowing them to be used by multiple SQL statements, so answer is B, D, F

Joe

Joe

E is wrong “only column group statistics”

Mohammad Rafiq

Mohammad Rafiq

B, D and F

RS VASAN

RS VASAN

SQL Plan Directives
• A SQL plan directive is additional information and instructions that the optimizer can use to generate a better plan:
– Collect missing statistics.
– Create column group statistics.
– Perform dynamic sampling.
• Directives can be used for multiple statements:
– Directives are collected on query expressions.
• They are persisted to disk in the SYSAUX tablespace.
• Directives are automatically maintained.
C and E are obviously wrong. A is wrong.

Answers: B, D, F

praveen

praveen

BDF correct as RS VASAN explained.

search for “twp-optimizer-with-oracledb-12c-1963236.dpf” document on internet and read “SQL Plan Directive” section this explains how the optimizer works. Very nice document.

Suggested Studying

Suggested Studying

Good blog post. I definitely love this website. Keep writing!|

simply click the next website page

simply click the next website page

First off I want to say fantastic blog! I had a quick question in which I’d like to ask if you don’t mind. I was curious to know how you center yourself and clear your thoughts before writing. I’ve had difficulty clearing my mind in getting my ideas out there. I truly do take pleasure in writing however it just seems like the first 10 to 15 minutes are usually lost simply just trying to figure out how to begin. Any suggestions or tips? Cheers!|

click the up coming webpage

click the up coming webpage

Fantastic items from you, man. I have be mindful your stuff prior to and you’re simply too excellent. I actually like what you’ve got here, really like what you are stating and the way in which during which you are saying it. You’re making it entertaining and you continue to care for to stay it sensible. I can’t wait to read far more from you. This is actually a wonderful site.|