Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: cost in explain plan table ?

Re: cost in explain plan table ?

From: Y <a_at_b.c>
Date: Sat, 23 Feb 2002 04:48:14 GMT
Message-ID: <3C771F39.28D65E34@b.c>

Ricky Sanchez wrote:

> Y-
>
> I have no idea what your first sentence means, but with respect to the
> second sentence, the meaning of COST is the same within the same
> session. the CBO will always choose the least cost method. But, since
> you run a query with one mode versus another, each plan output will give
> you different cost values. So, how do you compare the two? Take the
> least cost plan? No, not necessarily.
>
> Tuning by "least cost" will not necessarily give you the best
> performance result. You need to tune for minimal logical reads, not
> cost. Logical reads are physical reads plus buffer gets.

Thank you, ricky!
I think logical reads are buffer gets, not plus physical reads. For the same query, if the other conditions are the same, if you can make minimal logical reads, you must get the better performance result, and "least cost". (I mean when I care response time.)
Regards,

>
>
> And, since you are telling the optimizer to bias toward either
> throughput (ALL ROWS) or response time (FIRST ROWS), you have to balance
> a tradeoff. Do you indeed want faster throughput at the expense of
> response time? Pick one and tune accordingly.
>
> Create your query and test it with realistic data, from the same network
> location you will use in production. Use something like SQL*PLUS with
> both timing and auto trace on. Run the actual query and check the
> end-to-end performance. Don't forget to adjust arraysize to optimize
> network performance (larger arraysize = better network usage).

>
> - ricky
>
> Y wrote:
> >
> > Hi,
> > Does the column cost of plan table store the timerons?
> >
> > Is the meaning of COST the same if I let the OPTIMIZER use ALL_ROWS or
> > FIRST_ROWS?
> > Thanks in advance!
Received on Fri Feb 22 2002 - 22:48:14 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US