query optimization phase [message #612295] |
Tue, 15 April 2014 13:18 |
|
Johnny_aig
Messages: 4 Registered: April 2014
|
Junior Member |
|
|
I faced with a question these days and I was in doubt about the correct answers. In my opinion, not just two answers are possible, even if the question was like "which two tasks are performed during the optimization stage of a sql statement"
And, as I remember, this was the list of possible answers:
a - evaluating the expressions and conditions in the query (in my opinion this is correct, as I can see here http://docs.oracle.com/cd/B10500_01/server.920/a96533/optimops.htm#40574 )
b - checking the syntax and analyzing the semantics of the statement (this is false, as this is done in the parse stage, and the result of the parse stage which consists of a set of query blocks is then sent to the optimizer)
c - separating the clauses of the sql statement into structures that can be processed (not sure about what "structures that can be processed" really are)
d - inspecting integrity constraints and optimizing the query based on this metadata (correct? as per http://docs.oracle.com/cd/E16655_01/server.121/e17749/schemas.htm#DWHSG8151 , this option should be correct)
e - gathering the statistics before creating the execution plan for the statement (not really clear...they can be gathered automatically or not, but not implicitly gathered automatically).
I was in doubt here. However, B is definitely false.
Any suggestions?
Thank you!
[Updated on: Tue, 15 April 2014 13:37] Report message to a moderator
|
|
|
Re: query optimization phase [message #612320 is a reply to message #612295] |
Wed, 16 April 2014 01:06 |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
Johnny_aig wrote on Tue, 15 April 2014 23:48c - separating the clauses of the sql statement into structures that can be processed (not sure about what "structures that can be processed" really are)
It means the sql statement transformation stage where a complex query with lots of clauses is resolved into a compound query to improve the efficiency of the query execution, such that the goal remains the same.
|
|
|
|
|
|
|
Re: query optimization phase [message #612352 is a reply to message #612350] |
Wed, 16 April 2014 08:21 |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
In your original post you stated that option d is correct per the docs. So why are you unclear now?
Anyway, constraints have an important role in optimizing the execution plan. Yes, it is METADATA. The optimizer needs this metadata to make it's choice for an optimized execution plan. It all depends on as much information you provide to the optimizer. Read the documentation to understand the use of constraints, they take care of the integrity of the data in your DB. There are numerous explanations about the importance of integrity constraints. Good luck!
|
|
|
|
|