What is CPU cost?

dear all
what is CPU cost in execution plan?
thanks
john

hi,
I like one of the finest explanation and demo was provided in Charles hooper blog. I would have explained the same, but it's own's by charles itself.
refer to his link.. http://hoopercharles.wordpress.com/2010/02/19/what-is-the-meaning-of-the-cpu-column-in-an-explain-plan/
I like the most.
HTH
- Pavan Kumar N

Similar Messages

  • What is the difference between est. cost, CPU cost, and IO cost

    When looking at and execution plan there is est. cost, CPU cost, and IO cost.
    Can someone explain these and more importantly explain which one is the most
    important to tune and the step to take to reduce these cost to a respect level.
    I have seen many program hit 10,000 cost and 1 Mio CPU cost and I need to get that down to improve performance.
    I am running on 10.2.
    Thanks
    Mikie

    Hi Olivier,
    sorry to disagree but:
    > They're both important and you'll have to balance
    > both. For instance a program accessing the database
    > too much (lots of I/O) may run for ages. You can tune
    > this program and lower your I/Os, therefore
    > increasing your CPU time; the quantity of work is
    > still the same!
    is just not right.
    The amount of work to do for the database to get the job done (that is to deliver the requested results) may vary A LOT!
    That is why there is a optimizer at all.
    It's true: I/O cost model the time required to perform necessary read/write operations and CPU cost do the same for handling the data in memory.
    With indexes, database features active and database versions the optimizer can choose from selecting different access, filter and sorting mechanisms to answer the db requests.
    Usually there's not much you can do to the CPU costs - the database has it's internal rating concerning how "expensive" a sort-merge-join will be or a hash-distinct function.
    What you can (and usually should) do, is to lower the main contributor to processing and I/O costs: the volume of data.
    Therefore one will try to reduce the number of rows to be processed early in the query process. That can either be done by changing the selection itself or via the indexing scheme. Furthermore physical I/O might be reduced by using specific db features (compression, datablock sizing, bitmap indexes, partitioning etc.).
    Anyhow, to come back to the original post: it's important to think of costs as time-to-execute modelled in CPU-activity and I/O-operations.
    The goal is to deliver the result at the fastest - so, nobody should bother about the absolute numbers when it comes to costs. The question has to be: what execution time is meant with this?
    KR Lars

  • CPU Cost of a Query without executing it?

    Is there any mathematical formula to find CPU cost of a query without executing it? Thanks

    902181 wrote:
    Is there any mathematical formula to find CPU cost of a query without executing it? ThanksAny why do you want the cost? What do you expect it to tell you? How are you planning to apply this in your code? Make sure you understand what cost tells you and what it does not tell you. And use that value in a sane fashion.
    As for an alternative to using EXPLAIN PLAN, you can simply parse a SQL into a cursor without executing it. Then determine the SQL cursor id and address and use DBMS_XPLAN to display its execution plan.
    E.g.
    SQL> create or replace procedure ParseSQL( sqlStatement varchar2 ) is
      2          c       integer;
      3  begin
      4          c := DBMS_SQL.open_cursor;
      5 
      6          DBMS_SQL.parse(
      7                  c,
      8                  sqlStatement,
      9                  DBMS_SQL.native
    10          );
    11 
    12          DBMS_SQL.close_cursor( c );
    13  end;
    14  /
    Procedure created.
    SQL>
    SQL> var sqlID varchar2(100)
    SQL> var childNumber number
    SQL> var sqlText varchar2(4000)
    SQL> begin
      2          ParseSQL( 'select /* TEST1 */  * from emp' );
      3 
      4          select
      5                  sql_text, sql_id, child_number into :sqlText, :sqlID, :childNumber
      6          from    v$sql
      7          where   sql_text like 'select /* TEST1 */%';
      8  end;
      9  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> col PLAN_TABLE_OUTPUT format a50
    SQL> select
      2          rownum, p.plan_table_output
      3  from       TABLE( DBMS_XPLAN.Display_Cursor( :sqlID, :childNumber, 'BASIC,COST' ) ) p;
        ROWNUM PLAN_TABLE_OUTPUT
             1 EXPLAINED SQL STATEMENT:
             2 ------------------------
             3 select /* TEST1 */  * from emp
             4
             5 Plan hash value: 3956160932
             6
             7 -----------------------------------------------
             8 | Id  | Operation         | Name | Cost (%CPU)|
             9 -----------------------------------------------
            10 |   0 | SELECT STATEMENT  |      |     3 (100)|
            11 |   1 |  TABLE ACCESS FULL| EMP  |     3   (0)|
            12 -----------------------------------------------
            13
    13 rows selected.
    SQL> The problem is extracting intelligence from the output as it is raw text. Perhaps not that complex as a where clause can be added to only display line id 0 and then extract the cost value from that line. Regular expressions (not my forte) will likely do this easily.

  • What is the cost of replacing the screen on an i-pod touch

    Need to replace a brken screen on an i-pod touch and had bad experience with a non-apple repair on an i-phone so what sort of cost can I expect if asking apple to do the repair?

    Apple will exchange your iPod for a refurbished for this price:
    Apple - Support - iPod - Repair pricing
    A third-party place like the following may be less expensive. Google for more places.
    iPhone Repair, Service & Parts: iPod Touch, iPad, MacBook Pro Screens

  • What is the cost of replacing iphone 5(broken screen, out of warranty) with a higher model maybe 5s? In India.

    Hi,
    Yesterday i dropped my phone and the screen got shattered. The phone is working fine. but the screen is cracked.
    After searching through the internet, i found out the following options:
    Getting Out-of-warranty Replacement.
    Getting the screen repaired by Apple Store.
    I am located in India and had  bought the phone from India only.
    So my questions are?
    What is the cost of getting an out-of warranty replacement for iPhone 5?
    Can i get a replacement for a higher model of iPhone( maybe 5s or upcoming iPhone 6). If yes, how much extra i'll have to pay?
    Is it possible to repair the broken screen in India? if yes, what will be the tentative cost?
    Thanks.

    ShadowDancer1000 wrote:
    All prices in US$.
    iPhone 5 screen replacement at an Apple store is ~$120.
    The price of getting the screen replaced in the US on the 5 is $150, and it is only available on the US as of now.
    iPhone 5 screen replacement at an non-official Apple retailer is $75-90
    Should the OP decide to go that route, he will be forfeiting future support from Apple, both in and out of warranty
    A new/refurb 16GB iPhone 5 from Apple is ~$400
    A used 16GB iPhone 5 on Craigslist or Swappa is ~$275-350
    Apple no longer sells the iPhone 5. They keep a number of units on hand for out of warranty service, which is $269 in the US.
    Buying from Craiglist (or on-line) is usually risky as the phones turn out to be not what they are advertised as.

  • What is the cost of replacing a keyboard

    I spilled a soft dring on my keyboard.  What is the cost of labor to replace a keyboard?  What is the cost of a keyboard for a Macbook?

    It might be more than just a keyboard.  You need to bring it somewhere to have the damage evaluated in person in order to obtain a proper estimate.

  • What is the Cost of replacing my iPhone screen

    What is the Cost of replacing the front screen ón my iphone4s?

    Apple doesn't replace screens, they just give you a new phone. Schedule a Genius Bar appointment at your local Apple Store and have a Genius look at it for you.

  • What is the cost of replacing a battery for an Ipad 2 in India? On asking the service centre, I was informed the entire Ipad would be replaced for 20K which is exorbitant. Is it advisable to buy the Apple protection program in this case?

    What is the cost of replacing a battery for an Ipad 2 in India? On asking the service centre, I was informed the entire Ipad would be replaced for 20K which is exorbitant. The same is done in US for a paltry (comparably) 100 dollars. Is it advisable to buy the Apple protection program in this case?

    Battery Replacement
    http://www.apple.com/batteries/replacements.html

  • What is the cost and process for factory refurbish of a tx2-1375dx with a blown system board?cc=us

    What is the cost and process for factory refurbish of a tx2-1375dx with a blown system board?
    How would one go about arranging for such service?
    Why is it impossible to contact a real human for support, either via online chat or phone? 

    Last I checked I am a real human, it is just that I do not work for HP and can't speak for them. HP would not be the place I would go for a "refurbish" job. They charge an arm and a leg for out of warranty service. You simply need to find someone to replace the system board (motherboard). It is also very likely on that model that you could have your system board repaired. There are many services on ebay that will repair the motherboard at the component level. The cost would be at or under $100 or so. I have more advice to give but many times I write a detailed response only to have the user never come back. I do check my posts so if you want more ideas just please respond. The tx2-1000 was one of the models affected by the nVidia issue that caused so many HP laptops made in the 2007-2009 era to fail prematurely. 

  • HT1689 What is the cost or problems with replacing a cracked screen?

    What does it cost or what are the issues replacing the screen if cracked?

    If you make a Genius Bar appointment at your nearest Apple Store you can do an out-of-warranty replacement (they don't fix it, they replace the entire iPhone) for $199 USD. If you just want to replace the screen check the internet for 3rd party repair sites.

  • What will CC cost me after the trial period is over?

    What will CC cost me after the trial period is over? All I want to do is download some of the plug-ins since my Flickr plug-in doesn't seem to work.

    Creative Cloud pricing and membership plans | Adobe Creative Cloud

  • HT4623 What is the cost to replace iPhone speakers

    What is the cost to replace iPhone 4S speakers

    Clean the dock connector with a soft, dry brush.  Clean out the headphone jack.
    Basic troubleshooting from the User's Guide is reset, restart, restore (first from backup then as new).  Try each of these in order until the issue is resolved.
    Deciding that a hardware issue exists before doing basic troubleshooitng is just jumping to conclusions.

  • What is the cost to replace an iPod touch screen?

    What is the cost to replace an iPod touch screen?

    Apple will exchange your iPOd for this price:
    Apple - Support - iPod - Repair pricing
    A third-party place like this one my be less expensive. Google for more.
    iPhone Repair, Service & Parts: iPod Touch, iPad, MacBook Pro Screens

  • What is the cost for Final Cut Pro if I don't have a previous version to update?

    What is the cost for Final Cut Pro if I don't have a previous version to update? I see the $299 price for updates.
    What is the brand new purchase price?

    Thanks so much. Yes I was thinking on the lines of PwnySlaystation's response.
    I appreciate the help.
    Will this new version run on OS 10.6.8?
    Thanks for the help.

  • Cpu costing is off (consider enabling it)

    Hi,
    I am using Oracle 10.2.0.3.
    Whenever I generate explain plan for any query, the very last line of explain plan is as below.
    cpu costing is off (consider enabling it)_
    It seems that optimizer didn't considerd CPU stats while generating plan for this.
    How to enable CPU statistics here?
    The parameter optimizer_mode value is "CHOOSE", and stats are being gathered at an interval of one week.
    When I use CPU_COSTING hint in the SQL, then this line went away, and the query plan also started giving CPU % in PLAN output. But how can I make this a default behaviour of optimizer ( Any parameter etc to be set in oracle 10g for this)?
    Thanks in advance.
    Best Regards,
    oratest

    oratest wrote:
    Hi,
    I am using Oracle 10.2.0.3.
    Whenever I generate explain plan for any query, the very last line of explain plan is as below.
    cpu costing is off (consider enabling it)_
    It seems that optimizer didn't considerd CPU stats while generating plan for this.
    How to enable CPU statistics here?
    The parameter optimizer_mode value is "CHOOSE", and stats are being gathered at an interval of one week.In your version of the database, the default value of optimizer_mode is ALL_ROWS. Is there any reason why you have changed it? You may want to post the output of following executed in SQL*Plus
    show parameter optimizer

Maybe you are looking for