Small Doubt Regarding CBO [message #203932] |
Fri, 17 November 2006 00:20 |
selvakumar_82
Messages: 138 Registered: October 2005 Location: chennai
|
Senior Member |
|
|
Hi Friends,
When I Execute some SQL query in TOAD, It is showing the Explan Plan for the process and also its showing COST values.
May i know how to findout which query is best based on the cost.
The COST values should be High or Low for better Tunning,and more over its explains the whole process of Query right.......?
Kindly any one clear my doubts
Regards
Selva
|
|
|
Re: Small Doubt Regarding CBO [message #203944 is a reply to message #203932] |
Fri, 17 November 2006 00:40 |
rleishman
Messages: 3728 Registered: October 2005 Location: Melbourne, Australia
|
Senior Member |
|
|
Ignore the COST. Oracle's CBO evaluates several possible plans and then shows you the one with the lowest cost. If you add hints and force it to choose a different plan, the cost will certainly go up - otherwise CBO would have selected the alternate plan.
This does not mean that your alternate plan will be slower. CBO is not infallible - far from it. The only way to tell whether an alternate plan will be faster is to run it and find out. Two COST figures for different plans tells you NOTHING about which one will be faster.
Ross Leishman
|
|
|
Re: Small Doubt Regarding CBO [message #203948 is a reply to message #203944] |
Fri, 17 November 2006 00:58 |
selvakumar_82
Messages: 138 Registered: October 2005 Location: chennai
|
Senior Member |
|
|
Ok,
So i have findout the timings of two Sql Query,
Then i have to deside which one is best....?
If the complexity of query is high its very difficult for me to go through the explain plan..
More over when i run the same query again and again,
its giving different times .
(Kindly give me)
Any other Solution......will be very helpful for me
Regards
Selvakumar.R
|
|
|
Re: Small Doubt Regarding CBO [message #204021 is a reply to message #203948] |
Fri, 17 November 2006 06:18 |
rleishman
Messages: 3728 Registered: October 2005 Location: Melbourne, Australia
|
Senior Member |
|
|
Let me put it another way.
You are at the horse-races. There are two horses: one is at odds of 6-1, another at 13-2. Does this tell you which horse is faster?
If not, how could you tell which horse is faster?
Ross Leishman
|
|
|