newbie question about cost of optimizer vs time of querry!
I was give a huge querry (which is used to form a view) to optimize and with sqlplus and autotrace/tkprof I got an initial cost of 431 and about 7 seconds total time elapse (set timing on in sqlplus and alter session flush shared_pool, first time execution).
I spend a lot of time tuning this query and it ended up written in a pipelined function within a package. Now the view is used to select from the function instead.
The cost is now 23.
I would have expected to see BIG improvement in the total time... maybe not as much a ration as with the cost because there is latency in network, cpu, disks &c... but at least a noticable improvement.