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: Oracle CBO query cost - retrieve value?

Re: Oracle CBO query cost - retrieve value?

From: Steve Howard <stevedhoward_at_gmail.com>
Date: Tue, 09 Oct 2007 14:21:24 -0000
Message-ID: <1191939684.169843.167510@r29g2000hsg.googlegroups.com>


On Oct 9, 3:30 am, Michael O'Shea <michael.os..._at_tessella.com> wrote:

<snip>

> SQL> SELECT EXTRACTVALUE(DBMS_XPLAN.BUILD_PLAN_XML(statement_id
> =>'something'),'/plan/operation[@id="0"]/cost/text()') theCost
> FROM DUAL;
>
> THECOST
> ---------------------
> 419
>

Even then, you need the sql_id prior to executing it. And even if you knew the sql_id, what if you have multiple child versions, each of which could have different plan with the same sql_id (as the OP has suggested he has).

This actually sounds like a reasonable request on the front, though. Obviously Oracle has calculated the cost prior to executing the query, so why not expose it to the user through an API? Received on Tue Oct 09 2007 - 09:21:24 CDT

Original text of this message

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