Re: Which plan is better - what COST really means ?

  • From: Connor McDonald <hamcdc@xxxxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Thu, 13 Jan 2005 14:16:23 +0000 (GMT)

Its a somewhat philosophical argument.

If the optimizer was perfect, the lowest cost would always be the fastest 
query, thats what the
cost is meant to signify.

But the optimizer can never be perfect...it would need to have up-to-date stats 
for every
permutation of column/table/join for every possible query...Thats a lot of 
stats!

So lower cost is the optimizer's best attempt at telling you the best query

hth
connor

--- Prem Khanna J <premj@xxxxxxxxxxxxxx> wrote:

> Friends,
> when i have got two plans , how do i decide 
> which one is the best ?
> 
> just read in asktom , that COST of a plan , 
> does not have any correspondence with response
> time of a query.
> 
> i.e.,a query with higher COST than another
>  can be faster.
> 
> if so , what in the execution plan does help 
> me to decide about a good (faster) plan ? 
> 
> unless i execute it , can't i know it ? 
> is that the only way !!!
> 
> Can someone throw light on this ?
> The environment is oracle 9.2.0.4/AIX5.2L.
> 
> Thanks in advance.
> 
> Regards,
> Prem.
> --
> //www.freelists.org/webpage/oracle-l
> 


=====
Connor McDonald
Co-author: "Mastering Oracle PL/SQL - Practical Solutions"
ISBN: 1590592174

web: http://www.oracledba.co.uk
web: http://www.oaktable.net
email: connor_mcdonald@xxxxxxxxx

Coming Soon! "Oracle Insight - Tales of the OakTable"

"GIVE a man a fish and he will eat for a day. But TEACH him how to fish, 
and...he will sit in a boat and drink beer all day"

------------------------------------------------------------


                
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - 250MB free storage. Do more. Manage less. 
http://info.mail.yahoo.com/mail_250
--
//www.freelists.org/webpage/oracle-l

Other related posts: