Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Cost vs efficiency?
I was reading some of the messages in asktom.oracle.com discussions and i
was wondering about the following:
One of the example was demonstrating the differences between using IN and
EXISTS with big and small tables. The only thing that made me confused is
that the same query when you run it using EXISTS has a larger cost than
when you run it using IN. And apparently by getting the statistics in each
run you can see the one with larger cost is more efficient than the one
with smaller cost, in terms of number of consistent gets, db block gets
and number of rows returned by each step in the execution plan.
My question is what does the cost mean? My understanding is that the optimiser, when using the cost based, will evaluate each execution plan and based on the least cost will determine which one to use. The least cost means that number of block reads/data and indexes will be minimum and in addition to other factors as well. right? So how come larger cost is more efficient than smaller cost query?
I wanted to post this question to Tom but apparently there is no posting messages to the site at present.
thanks for any help,
ZS
Received on Thu Oct 11 2001 - 19:13:15 CDT
![]() |
![]() |