How to reduce Costing

I have following query but the query takes too high costing, how should i reduce the cost.
TRANCHE_BALANCE table having partition.
query is
SELECT /* + NO_USE_HASH(tbb) index(tbb XIE3TRANCHE_BALANCE) index (tbb XIE4TRANCHE_BALANCE) */
tbb.project_id, tbb.tranche_nbr,
tbb.summary_date,
tbb.product_sub_type_code,
tbb.product_type_code,
CAST (tbb.crmcmt_usd_amt AS NUMBER) crmcmt_usd_amt,
CAST (tbb.crmdout_usd_amt AS NUMBER) crmdout_usd_amt,
CAST (tbb.crmmtm_usd_amt AS NUMBER) crmmtm_usd_amt,
CAST (tbb.crmoleq_usd_amt AS NUMBER) crmoleq_usd_amt,
CAST (tbb.crmunds_usd_amt AS NUMBER) crmunds_usd_amt,
CAST (tbb.crmamtm_usd_amt AS NUMBER) crmamtm_usd_amt
FROM mis.tranche_balance tbb,
mis.product_categorization pc
Where tbb.product_type_code = pc.product_type_code
AND tbb.product_sub_type_code = pc.product_sub_type_code;
PLAN SHOWS
SELECT STATEMENT CHOOSE
Cost :18,846 Bytes 97,768,6-368 Cardinality: 2,036,841
# HASH JOIN
Cost:18,846 Bytes :252 Cardinality : 2,036,841
INDEX FULL SCAN UNIQUE MIS.XPKPRODUCT_CATGORIZATION
Cost : 2 Bytes:252 Cardinality :36
PARTITION RANGE ALL
Partition #:3 Partition acessed #1 - #122
TABLE ACCESS FULL MIS.TRANCHE_BALANCE
Cost :18,789 Bytes : 83,510,481 Cardinality:2,036,841
Partition #:3 Partition acessed #1 - #122
Thanks for advance

debasishghosh wrote:
I have following query but the query takes too high costing, how should i reduce the cost.
TRANCHE_BALANCE table having partition.Firstly, regardless of the "cost", is the query performant? If not, take a read of the following thread...
When your query takes too long ...
Secondly, it would be helpful, when you post code or data, if you put {noformat}{noformat} tags before and after it so that the formatting is retained on the forum.  I'll do that here for you for now...SELECT /* + NO_USE_HASH(tbb) index(tbb XIE3TRANCHE_BALANCE) index (tbb XIE4TRANCHE_BALANCE) */
tbb.project_id, tbb.tranche_nbr,
tbb.summary_date,
tbb.product_sub_type_code,
tbb.product_type_code,
CAST (tbb.crmcmt_usd_amt AS NUMBER) crmcmt_usd_amt,
CAST (tbb.crmdout_usd_amt AS NUMBER) crmdout_usd_amt,
CAST (tbb.crmmtm_usd_amt AS NUMBER) crmmtm_usd_amt,
CAST (tbb.crmoleq_usd_amt AS NUMBER) crmoleq_usd_amt,
CAST (tbb.crmunds_usd_amt AS NUMBER) crmunds_usd_amt,
CAST (tbb.crmamtm_usd_amt AS NUMBER) crmamtm_usd_amt
FROM mis.tranche_balance tbb,
mis.product_categorization pc
Where tbb.product_type_code = pc.product_type_code
AND tbb.product_sub_type_code = pc.product_sub_type_code;
SELECT STATEMENT CHOOSE
Cost :18,846 Bytes 97,768,6-368 Cardinality: 2,036,841
# HASH JOIN
Cost:18,846 Bytes :252 Cardinality : 2,036,841
INDEX FULL SCAN UNIQUE MIS.XPKPRODUCT_CATGORIZATION
Cost : 2 Bytes:252 Cardinality :36
PARTITION RANGE ALL
Partition #:3 Partition acessed #1 - #122
TABLE ACCESS FULL MIS.TRANCHE_BALANCE
Cost :18,789 Bytes : 83,510,481 Cardinality:2,036,841
Partition #:3 Partition acessed #1 - #122
Without knowing your tables and what indexes you have defined on them and without knowing the number of rows of data as well as the cardinality and selectivity of the data, we're not going to be able to give any real advice.
What happens if you leave out the Hints?  (Index and Optimiser Hints shouldn't be used in production code, they should only be used for debugging - with the exception of the APPEND hints for inserts)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • How to Reduce cost of full table scan or remove full table scan while execu

    Dear Experts
    need your help.
    I execute a query and create a explain plan in that plan i found cost of a table is very high (2777) and it was full table scan.
    Please guide me How to Reduce cost of full table scan or remove full table scan while execute the query.
    Thanks

    Need your help to tune this query..
    SELECT DISTINCT ool.org_id, ool.header_id, ooh.order_number, ool.line_id,
    ool.line_number, ool.shipment_number,
    NVL (ool.option_number, -99) option_number, xcl.GROUP_ID,
    xcl.attribute3, xcl.attribute4
    FROM oe_order_headers ooh,
    xxcn_comp_header xch,
    xxcn_comp_lines xcl,
    fnd_lookup_values_vl fvl,
    oe_order_lines ool
    WHERE 1 = 1
    AND ooh.org_id = 1524
    AND xch.src_ref_no = TO_CHAR (ooh.order_number)
    AND xch.src_ref_id = ooh.header_id
    AND xch.org_id = 1524
    AND xcl.header_id = xch.header_id
    AND ool.line_id = xcl.oe_line_id
    AND ool.flow_status_code IN
    ('WWD_SHIPPED',
    'FULFILLED',
    'SHIPPED',
    'CLOSED',
    'RETURNED'
    AND ool.org_id = 1524
    AND ool.header_id = ooh.header_id
    AND xch.org_id = 1524
    AND fvl.lookup_type = 'EMR OIC SOURCE FOR OU'
    AND fvl.tag = '1524'
    AND fvl.description = xch.SOURCE
    AND EXISTS (
    SELECT 1
    FROM oe_order_lines oe
    WHERE oe.header_id = ool.header_id
    AND oe.org_id = 1524
    AND oe.line_number = ool.line_number
    AND oe.ordered_item = ool.ordered_item
    AND oe.shipment_number > ool.shipment_number
    AND NVL (oe.option_number, -99) =
    NVL (ool.option_number,
    -99)
    AND NOT EXISTS (
    SELECT 1
    FROM xxcn_comp_lines xcl2
    WHERE xcl.GROUP_ID = xcl2.GROUP_ID
    AND oe.line_id = oe_line_id))
    call count cpu elapsed disk query current rows
    Parse 1 0.07 0.12 12 25 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 2 103.03 852.42 176206 4997766 0 12
    total 4 103.10 852.55 176218 4997791 0 12
    In this LIO is very high...can u please help in resolving this performance issue

  • How to reduce costs and increase efficiency of pho...

    Dear Skype community! 
    I need to find some information about how to reduce costs and increase efficiency of phone calls in sales organisation? 
    What are advantages of Skype contarry to the concurrence ? I'm Inside Sales manager SEMEA
    Is there anyone who can explaine ? 
    thanks a lot !
    Solved!
    Go to Solution.

    Tilly_in_action,
    Review the following link:
    http://blogs.skype.com/2012/05/24/5-real-benefits-of-using-skype/
    Thanks,
    Kent C.

  • How to reduce cost for SAP Fiori Trial on CAL?

    Hi,
    I have created an account in Cloud Appliance Library with AWS as per OpenSAP  Course.
    It's showing the cost per hour as 3.30 USD  and per month 2379.20 USD.
    Can anyone suggest me how to reduce this cost per month to the minimum.
    I can't pay this much amount.
    Please guide how to utilize this at the optimum w.r.t to the cost.
    Regards,
    Ramana.

    Hi Ramana,
    The easiest way to optimize the costs is to suspend the instance when not used. The scheduling options in SAP CAL could help here.
    Best regards,
    Stanimir

  • How to reduce costs of ISP

    i have Qwest into my house...$50/month, then ISP, an additional $55/month...which is for VOIP and email...i am fixing to retire and need to seriously reduce my expenses...ideas?  most appreciated!!!

    Qwest ....can also be ISP for more$$$...
    So it's telephone plus cable plus internet, at $105 a month, or nothing? That is totally unreasonable. I would tell them either unbundle their Internet from cable TV, or take a hike. You should be paying half that.
    I'm with steve - no cable in Galt's Gulch. No TV at all. Never been happier. Netflix is all I need.

  • How to reduce IO COST???

    Dear All,
    Any one know how to reduce the IO COST?
    Thanks In advance.

    Your question is as generic as it could possibly be, and therefore it's not easy to help you. But in a nutshell, IO can be improved by spreading your tablespaces on different different disk readers/writers (not the correct word I'm sure, but hopefully you understand what I mean). Might be good for example to store your indexes in a different tablespace (disk) than the tables, so that there is not too much contention when using the index and table concurrently for a query. You could also reduce the amount of IO by creating new indexes when FTS against large tables are run (if enough of the rows are filtered out). Sorry, that was a very generic answer to a very generic question.
    Daniel

  • In  a SQL query whihc has join, How to reduce Multiple instance of a table

    in a SQL query which has join, How to reduce Multiple instance of a table
    Here is an example: I am using Oracle 9i
    is there a way to reduce no.of Person instances from the following query? or can I optimize this query further?
    TABLES:
    mail_table
    mail_id, from_person_id, to_person_id, cc_person_id, subject, body
    person_table
    person_id, name, email
    QUERY:
    SELECT p_from.name from, p_to.name to, p_cc.name cc, subject
    FROM mail, person p_from, person p_to, person p_cc
    WHERE from_person_id = p_from.person_id
    AND to_person_id = p_to.person_id
    AND cc_person_id = p_cc.person_id
    Thnanks in advance,
    Babu.

    SQL> select * from mail;
            ID          F          T         CC
             1          1          2          3
    SQL> select * from person;
           PID NAME
             1 a
             2 b
             3 c
    --Query with only ne Instance of PERSON Table
    SQL> select m.id,max(decode(m.f,p.pid,p.name)) frm_name,
      2         max(decode(m.t,p.pid,p.name)) to_name,
      3         max(decode(m.cc,p.pid,p.name)) cc_name
      4  from mail m,person p
      5  where m.f = p.pid
      6  or m.t = p.pid
      7  or m.cc = p.pid
      8  group by m.id;
            ID FRM_NAME   TO_NAME    CC_NAME
             1 a          b          c
    --Expalin plan for "One instance" Query
    SQL> explain plan for
      2  select m.id,max(decode(m.f,p.pid,p.name)) frm_name,
      3         max(decode(m.t,p.pid,p.name)) to_name,
      4         max(decode(m.cc,p.pid,p.name)) cc_name
      5  from mail m,person p
      6  where m.f = p.pid
      7  or m.t = p.pid
      8  or m.cc = p.pid
      9  group by m.id;
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 902563036
    | Id  | Operation           | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT    |        |     3 |   216 |     7  (15)| 00:00:01 |
    |   1 |  HASH GROUP BY      |        |     3 |   216 |     7  (15)| 00:00:01 |
    |   2 |   NESTED LOOPS      |        |     3 |   216 |     6   (0)| 00:00:01 |
    |   3 |    TABLE ACCESS FULL| MAIL   |     1 |    52 |     3   (0)| 00:00:01 |
    |*  4 |    TABLE ACCESS FULL| PERSON |     3 |    60 |     3   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    Predicate Information (identified by operation id):
       4 - filter("M"."F"="P"."PID" OR "M"."T"="P"."PID" OR
                  "M"."CC"="P"."PID")
    Note
       - dynamic sampling used for this statement
    --Explain plan for "Normal" query
    SQL> explain plan for
      2  select m.id,pf.name fname,pt.name tname,pcc.name ccname
      3  from mail m,person pf,person pt,person pcc
      4  where m.f = pf.pid
      5  and m.t = pt.pid
      6  and m.cc = pcc.pid;
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 4145845855
    | Id  | Operation            | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT     |        |     1 |   112 |    14  (15)| 00:00:01 |
    |*  1 |  HASH JOIN           |        |     1 |   112 |    14  (15)| 00:00:01 |
    |*  2 |   HASH JOIN          |        |     1 |    92 |    10  (10)| 00:00:01 |
    |*  3 |    HASH JOIN         |        |     1 |    72 |     7  (15)| 00:00:01 |
    |   4 |     TABLE ACCESS FULL| MAIL   |     1 |    52 |     3   (0)| 00:00:01 |
    |   5 |     TABLE ACCESS FULL| PERSON |     3 |    60 |     3   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    |   6 |    TABLE ACCESS FULL | PERSON |     3 |    60 |     3   (0)| 00:00:01 |
    |   7 |   TABLE ACCESS FULL  | PERSON |     3 |    60 |     3   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - access("M"."CC"="PCC"."PID")
       2 - access("M"."T"="PT"."PID")
       3 - access("M"."F"="PF"."PID")
    PLAN_TABLE_OUTPUT
    Note
       - dynamic sampling used for this statement
    25 rows selected.
    Message was edited by:
            jeneesh
    No indexes created...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Update New Records is taking much time to complete. How to reduce

    Hi,
    Iam having a Table with 200 Clumns and trying to Update 5 columns and the table has 5lakh Records. It is taking very much time 2hours to complete. Pls let me know why is this taking time how to reduce....
    In my ssis Package iam using
    Oracle Source
    Look up
    Oledb Command for the Update.
    Please help ism stuck?

    I have somthing like this..
    Update table
    Set column1 =@column1, column2=@column2,column3=@column3,column4=@column4,column5=@column5
    where column1=@column1
    in this case i need to add a index on column1 right? Pls llet me know
    Yes, an index in column1 (preferably clustered) would avoid the table scan for each update. The ELT the staging table alternative Jim suggested will likely perform better than individual updates for a large process like this.
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • How to transfer cost from old sales order (cancelled) to new sales order

    Hi Gurus
    I want to know, how to move cost from one sales order to another sales order.
    SD created sales order before 1 month and there was production order behind this. Production was completed and all the cost was moved to sales order and also SD has raised invoice on customer. This transaction was completed.
    The above order was rejected by customer due to some changes in the order. SD raised another sales order and production order was created to to additional work. Production transfered above stock (produce before on old production order) to new production order.
    My problem is stock is now transfered to new production order but cost is still sitting on old sales order. How do I transfer cost from old sales order to new sales order. SD cancelled old invoice and raised new one with full value (old + new work) on new sales order. Now cost is on old sales order and revenue is on new sales order.
    Please help.
    Thanks

    Hi
    I have reverse the sales order settlement, PP order settlement to sales order and I have also done KB11N for transfering the cost to the new production order.
    The only problem is I was unable to transfer labour hour confirmation as cost element used for this are not for transfering cost. If I will reverse the confirmation in PP order system will reverse material movement also which I don't want any more. Can you please tell me how to I reverse the Labour hours with out affecting goods movement?
    Many thanks

  • How to reduce memory use on my iMac

    How to reduce memory use on my iMac, OS X Yosemite, 2.7 GHz Intel Core i5
    8 GB memory
    Running very slowly, and the little spinning ball showing up.
    How do I clean up my IMac please?
    Should I use MacKeep or any clean up apps?

    When you see a beachball cursor or the slowness is especially bad, note the exact time: hour, minute, second.  
    These instructions must be carried out as an administrator. If you have only one user account, you are the administrator.
    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad and start typing the name.
    The title of the Console window should be All Messages. If it isn't, select
              SYSTEM LOG QUERIES ▹ All Messages
    from the log list on the left. If you don't see that list, select
              View ▹ Show Log List
    from the menu bar at the top of the screen.
    Each message in the log begins with the date and time when it was entered. Scroll back to the time you noted above.
    Select the messages entered from then until the end of the episode, or until they start to repeat, whichever comes first.
    Copy the messages to the Clipboard by pressing the key combination command-C. Paste into a reply to this message by pressing command-V.
    The log contains a vast amount of information, almost all of it useless for solving any particular problem. When posting a log extract, be selective. A few dozen lines are almost always more than enough.
    Please don't indiscriminately dump thousands of lines from the log into this discussion.
    Please don't post screenshots of log messages—post the text.
    Some private information, such as your name, may appear in the log. Anonymize before posting.

  • HT4528 I would like to know how much it costs to repair a power button on an iphone 5?

    I would like to know how much it costs to repair a power button on an iphone 5?

    https://ssl.apple.com/support/iphone5-sleepwakebutton/

  • My mac mini hard drive is failing. I am no longer under warranty. Do you know how much it cost to have Apple replace the hard drive? or How I can replace it myself?

    MY mac mini hard drive is failing. I am no longer under warranty. Do you know how much it cost to have Apple replace the hard drive? or How I can replace it myself?

    You can do it yourself. I did on my 2009 Mini
    http://www.ifixit.com/Device/Mac_Mini
    Also, this place sells HSDs and has install videos.
    http://eshop.macsales.com/installvideos/

  • How to calculate cost(COGS) in Sales from project

    Dear all,
    I have a situation like this:
    My customer do not emplement PS(project system) and when managing sales from project, i don't know how to calculate cost of good sold for the service line.
    Each project (contruction site; building, ....), I use 1 material master as service item to manage. while project excecution, we issue material; collect labor cost; cost of external service, so on.... total up to COGS. but i don't know how to get this one in Sales order. Could you give me some suggestions?
    thanks!

    Dear,
    You need to create all these activities ( LABOUR CCOST/ COST OSFG EXTERNAL SERVICES)as Service Material and then put it into S.O. as Service Item and Bill the same.
    Regards
    AJIT K SINGH
    HAPPY TO HELP U

  • How to reduce number of colors in an image

    I am fairly new to Photoshop and I'm learning as I go, so I apologize for using your time.  I haven't worked with images that much - I've used MS Digital Image Suite with photos from my camera.  That's the extent of my knowledge.
    I am taking over a job from someone who is gone and I can't ask him how to do this.  He used Photoshop to reduce the number of colors in an image (for example, a color drawing or clipart) to 2-6 colors.  I haven't been able to figure this out.  I've visited this site that explains how to reduce tones but it's still a lot of colors.  I thought I might learn something from this link that explained how to make Photoshop cartoons, but I didn't.  I've done a lot of searching but nothing seems to explain this.  I know that the other guy had some knowledge of Photoshop but he wasn't a power user.
    Thanks to anyone who will help me.  (I am using CS5.)

    Are you sure that he was using Photoshop? (see my third solution)
    There are some plug-ins for Photoshop, but they basically do the same as the posterize or index mode: http://www.topazlabs.com/simplify/ (commercial) see this panel for colorizing comic art: http://vimeo.com/user3771002/videos
    I would rather use posterize, as an adjustment layer, as you can control it.
    Try with this layer stack, from bottom to top:
    Convert the original image in a Smart Object, in order to use Smart filters and blur the image (Gaussian Blur, or noise>median or blur>smart blur or blur>surface blur could be interesting internatives) would be useful, to make smoother posterized areas.
    A dodge/burn layers (a neutral gray layer in overlay mode) to adjust areas using the Dodge/burn tools.
    the Posterize Adjustment layer, with very few colors
    On top of it, put a gradient map adjustment layer, to control the posterized colors
    Vectorizing in Illustrator can also be used to reduce the number of colors. Live Trace: http://help.adobe.com/en_US/illustrator/cs/using/WS714a382cdf7d304e7e07d0100196cbc5f-6229a .html
    More on the topic: http://help.adobe.com/en_US/illustrator/cs/using/WS714a382cdf7d304e7e07d0100196cbc5f-622aa .html

  • How to update cost condition VPRS and Updation from VPRS to new cond ZVPR

    Hi All,
    How to do and is there any way to update the VPRS cost condition whenever vendor sends confirmation of material and cost after purchase order.
    After receiving the confirmation form the vendor,the VPRS cost condition should get updated in the system automatically.
    We have one cost condition type ZVPR which is same and consists of same properties of VPRS. How to update this ZVPR condition from VPRS Condition.
    Thanks in advance....
    Regards....Venkat
    Edited by: venkat t on Feb 16, 2009 11:57 AM

    Hi venkat
    Check the link
    [How to update cost condition VPRS and Updating from VPRS to new cond ZVPR;
    NOTE : Dont post in many forums
    Regards
    Srinath

Maybe you are looking for

  • Safari 3.1 crash on start

    I installed Safari 3.1 from the Software Update menu, restarted the computer, and now the Safari icon bounces and then... nothing. Using a MacBook Pro w/Tiger 10.4.11. Any help would be appreciated.

  • How to log messages in Java class

    How to get interface to logger in a Java class? I need to access a log method that is available for a PageBean.

  • Konica c351 with fiery not working in Leopard

    Hi, We have a konica c351 with a fiery controller. Konica says they will not update leopard drivers for this machine. Any ideas?

  • [SOLVED] Gimp does not honor KDE Task Manager Settings

    I've configured the Task Manager to only display tasks from the current desktop. This works for every application except the Gimp, whose toolbox windows are shown in the task manager on every desktop. Is there some setting I could adjust to fix this?

  • OneDrive in File Explorer

    Some things I'd like to see implemented for OneDrive in File Explorer A different icon for folders online only / offline only / everywhere. A different icon for files online only / offline only / everywhere. The ability to view folders and files shar