Discrepancy Between Plan Cost and Actual Elapsed Time
Greeting All.
I just rewrote a SQL query to improve it's performance. The new query uses the same tables and returns the same result. The elapsed time reduced by 40% (not a lot), but plan cost increased by 94 times! All statistics are up to date and I executed each query multiple times. I could not believe that. So I checked SQL statistics and actual plans in EM Cloud Control (formerly Grid Control) and found the same. See below. Have any of you seen this kind of discrepancy, or am I missed some important points? The DB version is 11.2 on Linux-64.
Original statistics (4.83/exec):