Which two tasks are performed during the optimization stage of a SQL statement?

Which two tasks are performed during the optimization stage of a SQL statement?

Which two tasks are performed during the optimization stage of a SQL statement?

A.
Evaluating the expressions and conditions in the query

B.
Checking the syntax and analyzing the semantics of the statement

C.
Separating the clauses of the SQL statement into structures that can be processed

D.
Inspecting the integrity constraints and optimizing the query based on this metadata

E.
Gathering the statistics before creating the execution plan for the statement

Explanation:

Note:
* Oracle SQL is parsed before execution, and a hard parse includes these steps:
*
The parsing process performs two main functions:
o Syntax Check: is the statement a valid one. Does it make sense given the SQL grammar

documented in the SQL Reference Manual. Does it follow all of the rules for SQL.
o Semantic Analysis: Going beyond the syntax ? is the statement valid in light of the
objects in the database (do the tables and columns referenced exist). Do you have access
to the objects ? are the proper privileges in place? Are there ambiguities in the
statement ? for example if there are two tables T1 and T2 and both have a column X, the
query ?select X from T1, T2 where ?? is ambiguous, we don?t know which table to get X
from. And so on.
So, you can think of parsing as basically a two step process, that of a syntax check to
check the validity of the statement and that of a semantic check ? to ensure the
statement can execute properly.
Reference: Oracle hard-parse vs. soft parse



Leave a Reply 5

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


raka

raka

A and D should be correct.

martin

martin

this is why i look at the dump before exam, even mighty tom is not sure about some questions 🙂