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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: strange cost in explain plan

Re: strange cost in explain plan

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Fri, 12 Oct 2007 08:41:18 +0100
Message-ID: <006101c80ca3$475ae180$0200a8c0@Primary>

The statement: "the cost of the parent should be equal or larger than the child" is not strictly true.

Your basic plan is for

    select {} from PATH_RELATIONSHIP_TEMP x;

You then have a scalar subquery in the select list. Oracle therefore shows you two independent plans in the plan table. One for your driving query - which as a cost of two, and one for (each) scalar subquery, which has a cost of 2083 EACH TIME IT EXECUTES.

But Oracle does not know how many times the scalar subquery will run, and does not make any allowance for multiple executions in the total cost of the query.

Regards

Jonathan Lewis
http://jonathanlewis.wordpress.com

Author: Cost Based Oracle: Fundamentals
http://www.jlcomp.demon.co.uk/cbo_book/ind_book.html

The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Oct 12 2007 - 02:41:18 CDT

Original text of this message

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