Reg : Cost -

Hi Experts,
I'm trying to tune this query but nothing seems to reduce the cost.
Any pointers is highly appreciated.
PERSON_DETAIL – +2,275,776 rows+
D_OPN – +1,57,094+
D_GPN – +49,197+
Query fetches –- +2,704,577 rows+
explain plan for
SELECT 
               to_char(casd.transaction_date,'yyyy-mm-dd')||'T'||to_char(casd.transaction_date,'hh24:mi:ss')||'.000' "Interaction Date",
               'en_US' "Locale",
               pd.email "Email",
               casd.myti_permid "User Id",
               pd.first_name "First Name",
               gpn.generic_part_number "Product",
               gpn.generic_part_number_id "Product ID",   
               'aaa'||gpn.generic_part_number "Product Image URL",
               NULL "Price"
          FROM customer_activity_samp_detail casd,
               person_detail pd,
               d_gpn gpn
        WHERE casd.stakeholder_num = pd.stakeholder_num
               AND EXISTS ( SELECT 1
                         FROM d_opn opn
                        WHERE opn.gpn_id = gpn.generic_part_number_id
                              AND opn.orderable_part_number(+) = casd.product);Explain Plan -
Plan hash value: 2059255244
| Id  | Operation                | Name                          | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT         |                               |   157K|    15M|       |   103K  (1)| 00:24:08 |
|*  1 |  HASH JOIN               |                               |   157K|    15M|       |   103K  (1)| 00:24:08 |
|   2 |   MAT_VIEW ACCESS FULL   | D_GPN                         | 49197 |   768K|       |   214   (1)| 00:00:04 |
|*  3 |   HASH JOIN              |                               |   157K|    13M|     9M|   103K  (1)| 00:24:05 |
|*  4 |    HASH JOIN             |                               |   157K|  8284K|  4768K| 72234   (1)| 00:16:52 |
|   5 |     SORT UNIQUE          |                               |   157K|  2914K|       |   357   (1)| 00:00:06 |
|   6 |      MAT_VIEW ACCESS FULL| D_OPN                         |   157K|  2914K|       |   357   (1)| 00:00:06 |
|   7 |     TABLE ACCESS FULL    | CUSTOMER_ACTIVITY_SAMP_DETAIL |  2704K|    90M|       | 65569   (1)| 00:15:18 |
|   8 |    TABLE ACCESS FULL     | PERSON_DETAIL                 |  2272K|    75M|       | 25340   (1)| 00:05:55 |
Predicate Information (identified by operation id):
   1 - access("OPN"."GPN_ID"="GPN"."GENERIC_PART_NUMBER_ID")
   3 - access("CASD"."STAKEHOLDER_NUM"="PD"."STAKEHOLDER_NUM")
   4 - access("OPN"."ORDERABLE_PART_NUMBER"="CASD"."PRODUCT")Database version -
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
PL/SQL Release 10.2.0.3.0 - Production
CORE     10.2.0.3.0     Production
TNS for Solaris: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production

Jeneesh,
Why the EXISTS is giving better result than the ANSI OUTER JOIN ???
Both gives result with RowCount = 2,702,110 rows
1] Query Using EXISTS -
explain plan for
SELECT
               to_char(casd.transaction_date,'yyyy-mm-dd')||'T'||to_char(casd.transaction_date,'hh24:mi:ss')||'.000' "Interaction Date",
               'en_US' "Locale",
               pd.email "Email",
               casd.myti_permid "User Id",
               pd.first_name "First Name",
               gpn.generic_part_number "Product",
               gpn.generic_part_number_id "Product ID",   
               'aaa'||gpn.generic_part_number "Product Image URL",
               NULL "Price"
          FROM ezmad.customer_activity_samp_detail casd,
               ezmad.person_detail pd,
               ezmad.d_gpn gpn
              -- ezmad.d_opn opn
        WHERE casd.stakeholder_num = pd.stakeholder_num
               -- AND opn.gpn_id = gpn.generic_part_number_id
                --AND opn.orderable_part_number(+) = casd.product;
               AND EXISTS ( SELECT 1
                         FROM ezmad.d_opn opn
                        WHERE opn.gpn_id = gpn.generic_part_number_id
                              AND opn.orderable_part_number(+) = casd.product);
Plan hash value: 2059255244
| Id  | Operation                | Name                          | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT         |                               |   157K|    15M|       |   103K  (1)| 00:24:08 |
|*  1 |  HASH JOIN               |                               |   157K|    15M|       |   103K  (1)| 00:24:08 |
|   2 |   MAT_VIEW ACCESS FULL   | D_GPN                         | 49197 |   768K|       |   214   (1)| 00:00:04 |
|*  3 |   HASH JOIN              |                               |   157K|    13M|     9M|   103K  (1)| 00:24:05 |
|*  4 |    HASH JOIN             |                               |   157K|  8284K|  4768K| 72234   (1)| 00:16:52 |
|   5 |     SORT UNIQUE          |                               |   157K|  2914K|       |   357   (1)| 00:00:06 |
|   6 |      MAT_VIEW ACCESS FULL| D_OPN                         |   157K|  2914K|       |   357   (1)| 00:00:06 |
|   7 |     TABLE ACCESS FULL    | CUSTOMER_ACTIVITY_SAMP_DETAIL |  2704K|    90M|       | 65569   (1)| 00:15:18 |
|   8 |    TABLE ACCESS FULL     | PERSON_DETAIL                 |  2269K|    75M|       | 25340   (1)| 00:05:55 |
Predicate Information (identified by operation id):
   1 - access("OPN"."GPN_ID"="GPN"."GENERIC_PART_NUMBER_ID")
   3 - access("CASD"."STAKEHOLDER_NUM"="PD"."STAKEHOLDER_NUM")
   4 - access("OPN"."ORDERABLE_PART_NUMBER"="CASD"."PRODUCT")2] Query using ANSI OUTER JOIN -
explain plan for
SELECT 
               to_char(casd.transaction_date,'yyyy-mm-dd')||'T'||to_char(casd.transaction_date,'hh24:mi:ss')||'.000' "Interaction Date",
               'en_US' "Locale",
               pd.email "Email",
               casd.myti_permid "User Id",
               pd.first_name "First Name",
               gpn.generic_part_number "Product",
               gpn.generic_part_number_id "Product ID",   
               'aaa'||gpn.generic_part_number "Product Image URL",
               NULL "Price"
          FROM ezmad.customer_activity_samp_detail casd
          join  ezmad.person_detail pd on (casd.stakeholder_num = pd.stakeholder_num)
          left outer join ezmad.d_opn opn on (opn.orderable_part_number = casd.product)
          join ezmad.d_gpn gpn on (opn.gpn_id = gpn.generic_part_number_id);
Plan hash value: 735325213
| Id  | Operation               | Name                          | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT        |                               |  2720K|   272M|       |   111K  (1)| 00:26:01 |
|*  1 |  HASH JOIN              |                               |  2720K|   272M|       |   111K  (1)| 00:26:01 |
|   2 |   MAT_VIEW ACCESS FULL  | D_GPN                         | 49197 |   768K|       |   214   (1)| 00:00:04 |
|*  3 |   HASH JOIN             |                               |  2720K|   230M|   101M|   111K  (1)| 00:25:58 |
|   4 |    TABLE ACCESS FULL    | PERSON_DETAIL                 |  2269K|    75M|       | 25340   (1)| 00:05:55 |
|*  5 |    HASH JOIN            |                               |  2720K|   140M|  4768K| 72234   (1)| 00:16:52 |
|   6 |     MAT_VIEW ACCESS FULL| D_OPN                         |   157K|  2914K|       |   357   (1)| 00:00:06 |
|   7 |     TABLE ACCESS FULL   | CUSTOMER_ACTIVITY_SAMP_DETAIL |  2704K|    90M|       | 65569   (1)| 00:15:18 |
Predicate Information (identified by operation id):
   1 - access("OPN"."GPN_ID"="GPN"."GENERIC_PART_NUMBER_ID")
   3 - access("CASD"."STAKEHOLDER_NUM"="PD"."STAKEHOLDER_NUM")
   5 - access("OPN"."ORDERABLE_PART_NUMBER"="CASD"."PRODUCT")Any pointer guys???
Edited by: ranit B on Dec 19, 2012 5:35 PM
Edited by: ranit B on Dec 19, 2012 5:36 PM

Similar Messages

  • Reg:Cost Center Creation?

    Hi all,
       I would like to capture the expenses incurred by vendor while transporting goods from plant location to customer location in one cost center.
    will any please let me know-
    what are all the config I have to do?
    plz starting from the Create Costcenter step by step?
    *points will be rewarded

    hi
    for Cost center seetings
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/COALE/COALE_ALE_060.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/COOMCCA/COOMCCA.pdf
    http://help.sap.com/erp2005_ehp_03/helpdata/EN/13/05b3ae635611d2b43b006094b9c9b4/frameset.htm
    http://help.sap.com/erp2005_ehp_03/helpdata/EN/08/51457e43b511d182b30000e829fbfe/frameset.htm
    http://help.sap.com/erp2005_ehp_03/helpdata/EN/66/bc783643c211d182b30000e829fbfe/frameset.htm
    http://help.sap.com/erp2005_ehp_03/helpdata/EN/13/248f38c521853ae10000009b38f8cf/frameset.htm
    http://help.sap.com/erp2005_ehp_03/helpdata/EN/25/908fc66d8411d194f000a0c93031df/frameset.htm
    http://help.sap.com/erp2005_ehp_03/helpdata/EN/af/3f89c89e6711d395da00a0c929f4c9/frameset.htm

  • Reg:- Cost in Maintenance orders

    Hi
    I have an issue with Maintenance Orders.
    in Customizing i have created value categories and assigned cost elements to them but when i am posting the material which was reserved from the maintenance order the cost is not updating  in the value categories assigned to the order in Costs tab.
    please any one give suggestion on this to how the cost is updated in the value categories in cost tab.
    Please reply...
    Regards
    Kumar

    Check in OBYC for GBB - VBR for the material valuation class. Assign those cost elements in material value categories, so that cost will be updated under proper head.

  • Reg:Cost Component Structure

    Hi Guru's
    In the Cost Compenent Structure T.Code:OKTZ I Select Primay Cost Component Split,
    I Excuted Two Standard Cost Estimates one is with out Primary Cost Component Split, and Secound one with Primary Cost Component  Split
    But I can't see the Difference for both Standard Cost Estimates....
    where we can see the Diffierence exactly for with and without Primary Cost Component Split...
    Rgds
    U.SRINU
    SAP Pratice (FI/CO)

    Hi Srinu,
    Go through the following thread to understand the purpose of Primary Cost Component Split...
    Re: Primary cost component split
    If you have understood the details from the above thread, go through the following...
    If you want to go for Primary Cost Component Split, the following sequence MUST be followed...
    1. Activate Primary Cost Component Split in OKTZ,
    2. Mention your Cost Component Structure name (for ex: 01) in your Version Maintenance in OKEQ
       ( In OKEQ, select your Version, Go to Controlling Area settings, go in to Settings for Fiscal Year. In "Price Calculation" Tab, you will find the field for Cost Component Structure).
    3. Upload the Cost Center Planning Data using this Version.
    Now, what you might have tested is that, you have done the Cost Center Planning as usual ( I guess you missed the above sequence, especially point no.2) and you run the Std Cost Estimate. After that, you have Activated the Primary Cost Component Split and you might have run the Std Cost Estimate. Obviously, you will not find any difference in that case.
    I have used Primary Cost Component Split in couple of my implementations and it worked fine.
    Revert back if you need further explanation in this regard....
    Srikanth Munnaluri

  • Reg:Cost Estimate without Quantity Structure

    Hi Guru's,
    For Cost Estimate with Quantity Structure we need to run the following T.Codes....
    1) KP06
    2) KP26
    3) KSPI
    4) CS01
    5) CA01
    6) CR01
    7) CK11N
    8) CK24
    I want what are the T.Codes for Cost Estimate without Quantity Structure

    Hi,
    while am doing T.Code:KKPAN the following issue is coming....
    *Material F29 in plant 1000 w/o cost comp split: price acc to val strategy
    Message no. CK193*
    Diagnosis
    When valuating material components,
    the system could not find a cost component split for F29 in plant 1000.
    Possible causes:
    The material has not been costed.
    The material has not been selected for the costing run.
    The BOM was changed after the selection or BOM explosion for the costing run was carried out, and the material now has a new low-level code.
    This is a configurable material and does not have a costing view in the material master.
    The default value for price control is not set in the material type.
    The material belongs to a recursive structure. With this material, the system begins the iterative costing of the cycle. You can check in the material overview of the cost estimate whether the material belongs to a cycle.
    System Response
    The material is valuated with the price determined through the valuation strategy.
    Procedure
    Check the log.
    Carry out selection and BOM explosion for the costing run again.
    If the material is a configured material, create a costing view in its master record.
    Note: I already checked cost component spilt assigned for Plant....

  • Reg:cost reduction reports

    The issue is that, in the purchase, we have around 1000 suppliers and each supplier may supply atleast 20 to 30 materials. The management given some project to the purchase team that to bring down the cost of the materials. The team negotiated with suppliers and bring down the prices. Each and every transaction happened through SAP.
    At the end of the each quarter the team has to give the report to the management that what is cost reduction has on each material and vendor. How it is possible with SAP to get the detailed reports.

    Dear,
            I give you some name of report if you don't get from it then you go your ABAP developer. He will create the Z report and give you data as per your requirement.
          T.Code  OPR4_CK : Material Cost Estimate
          T. Code OPR4_CKMC : Mass Costing - Sales Documents
          T. Code  OPR4_PPCO : Production Order: Cost Calculation
    Regards,
    Sandip

  • Reg: Costing details for PP point of view

    Dear SAP Gurus
    I am balaji
    Now i am in post go live support project
    For our client, we recommend Repetitive manufacturing process
    Order : Planned order consumption thro back flush MFBF.
    Costing : We have parameter, formulaes, primary and secondary cost element, cost center, profit center
    and product cost collector.
    then the cost will flow thro work center ->routings->BOM---> Planned Order.
    Now they are not running the costing run every month. Then In which way the cost will be calculated for all materials
    And also could you please explain me the details about the costing plan and costing run and costing configuration for PP point of view.
    Thanks in advance
    Thanks & Regards
    VBalaji

    Dear Surya
    Thanks for your reply.
    i checked okkn , in that following details are available
    costing varient:pc01:  control 1
    costing type: std cst estimate
    valuation varient:planned val
    date control:std cost estimate month
    qty structure: BOM/Routing  (They select the "ignore prod cost est w/o qty structure" option)
    In REM profile :
    control data 1
    cost accounting section:
    they select option:"using data from prelim costing from prod cst collector."
    Now i come to the question, here for the past 6 months they are not running costing run.
    in which way the prices are getting updated.
    Atleast, they run first time , is it? they didn't run.
    Now how can i check the updated cost. bcas on weekly basis all componunt's prices are changing here.
    could you please tell me the way of costing here, if you need furthur details, please tell me.
    Thanks & Regards
    VBalaji

  • Reg:Cost Centers

    Hi All,
    am preparing Controlling with the reference of Builiding Block N71,
    In that Builiding Block given all the CO Master Data with Allocation type
    Alloc.Type
    PA
    PA
    OH
    OH
    OH + PA
    PA
    AA
    AA
    AA
    PA
    PA
    PA
    PA
    AA
    AA
    Dist.
    PerR
    AA
    Explanation:                                                  
    Allocation Type:PA=Assessment to CO-PA, ***.=Assessment, OH=Overhead Rate, Dist.=Distribution, PerR=Periodic Reposting     
    see the Allocation type in Builiding Block wat is meant By AA

    Hi,
    Direct activity allocation involves the measuring, recording, and allocating of business services performed.
    To do this, you must create the relevant (measurable) tracing factors (allocation bases which can be used as cost drivers). In Cost Center Accounting these are known as activity types.
    Activity allocation occurs, for example, when business transactions are confirmed or when posting activity quantities to accounts.
    The system multiplies the activity produced by the price of the activity type.
    To do so, for the cost centers or business processes involved, you must plan activity types either using prices set manually or using subsequent iterative price calculation.
    http://help.sap.com/saphelp_erp60/helpdata/en/5b/d2200743c611d182b30000e829fbfe/frameset.htm
    GL

  • Reg:Cost Object Controlling

    Hi All,
    While am doing the T.Code: MFBF - REM Backflush (For Repetative Manufactring) the following Issue is coming
    E:M7:226 131 _ _ _ F
    Message no. M7226

    Hi Suryanarayana,
    Please Do me the favour, no MM guy is available right know
    see the following movement types i assigned on REM Profile
    Movement Types
    Goods issue     261                        Goods issue/reversal  262
    Goods receipt    131                      Goods receipt/reversal  132
    Scrap                 551                      Scrap/reversal              552
    By-product          531                      By-product/reversal        532
    Additional movement types relevant fot make-to-order  scenrio
    GR Individual SOrd        571                  GR Indiv. Order Reversal           572
    GI Ind. Stock/SOrd       572                 GI SO Stock/Sorder/Canc.         571
    GI PlntStock/SOrd        291                 GI Pl. Stock/SOrder Rev.            292

  • MFBF- Costing Issue

    Dear Friends,
    I have one issue reg. costing in MFBF.When do yield / scrap posting in MFBF , in post with correction screen we remove some of the components which are not consumed especially in case of scrap posting of assembly but system will consider assembly cost i.e. cost of header material as per std cost estimate only considering all components.Is there any way by which we can get the actual cost as per component consumption in MFBF?
    Awaiting your valuable inputs in this matter.
    Thanks & Regards,
    Tejas

    Dear Tejas,
    This is not possible.
    First let me clear one thing from your side,you are saying 10 components are required for making a
    product.
    Does it mean 10 quantity of a component or 10 different components?
    IF its going to be 10 different component's means,then there is no meaning in taking the costing run.
    This is because you are not certain about how the product is going to be produced,sometime it may
    happen by consuming all the 10 components and sometime it may be consuming 8 out of the 10
    different components.
    now case1 I hope you are suing standard cost estimate for backflushing the datas,so the system
    considers the std cost of the product while backflushing.
    Still your query is not clear.
    Please clarify my above doubts.
    Regards
    Mangalraj.S

  • Help reqd for determining header char combination in Manual Planning

    Hi,
    I have created a manual planning layout which has 3 chars in lead col, 5 KF in data col and all remaining chars in the header. Now when I display plan data for this layout at time it displays me records only for one combination of header chars. And so I have hit next combination button to navigate thru remaining records. Is there a way by which I can have all the records with all possible header char combination at once?
    If hit the other combination button and empty all the header fields and then execute it says me no records found for this combination coz then in this case it searches for the records with all the fields blank.
    Thank you,
    sam

    Multiple options:
    1. dependent characteristics (like profit centre / comp code) wont be modelled in the layout. You will have to derive them as chararacteristics relationship. If you wish to keep the dependent characteristics in the layout, then you need to write a exit variable which will populate comp code by reading profit center. Reg cost element, you can have it in loead column. With this setting, if you chose a profit centre in the header and the company code will be populated and for a given profit centre, you cna view the plan data.
    2. Create a report and this is a better approach. You dont need a exit or anything. From report, build a jump to UPSPL for entering plan data.
    Ravi Thothadri

  • MF70- separated backflushing  issues-COST COLLECTOR BLOCKED -reg

    Hiiiiiiiiiii,
    Short Text .   
    MF70-Separated Back Flush Process Encountering issues -reg    
    Long Text    
    While performing MF 70-Separated Back Flush Process System is
    encountering Major Errors
    1.Cost Collector Blocked
    2.Maximum No.of FI items reached
    Checked for up to date costing, need inputs to resolve the above
    issues       
    Steps for Reconstruction    
    MF70-CHECK " Post goods issue" -check "make to stock "---
    plant "H001"-Material "G51900305R"--Posting date "01.04.2008 to
    13.05.2008"----
    check "parallel processes " in
    Settings
    ( Step wise details are atatched in the atatchment )
    Cost collector blocked is the major issue as max no.of FI items reached needs a decesion to make on  some customization
    Madhu Kiran,,,,,,,,

    Hi,
    Refer the OSS Notes: 562387 & 539452.
    It may be useful.
    Regards,
    Siva

  • COGS (Cost of the Goods Sold) in OPM reg.

    Hi
    Can anyone provide the details about COGS (Cost of the goods sold) documents/set up in R12.
    This is very urgent.
    Kindly do the needful.
    Mail id : [email protected]
    Regards
    Raj

    Hi,
    1. Cost of manufacture of a Product is what the value of goods sold or Cost of Goods sold (COGS). Either, you use the SAP Costing module (CO-PC) to let SAP determine COGS or you can manullay input COGS into material master fields (Standard or Moving Average) in Accounting view of Material master. In either case, COGS is stored in the material master valuation (Accounting) view.
    2. You mean in a COGS? Whatever costs it takes to manufacture a product is included in COGS, for instance Material cost, Labor cost etc.,
    Hope this helps.
    PS: There is lot of documentation available online SAP help protals and please refrain from using this forum for asking such basic questions and restrict to only questions of clarificatory in nature or issue based questions.
    Make an effort to read the SAP help documentation for all your basic questions.
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/80/ea89395eb58c4f9d0c3e837cf0909d/frameset.htm
    Mods (Moderators) will lock your threads, if you continue to ask such basic questions, so no one can reply to it.
    Edited by: Pradeep kumar Athmakur on Feb 27, 2010 12:41 AM

  • Shipping cost not getting calculated in CRM IC webclient for a certain regi

    HI all,
    I have an issue where when we create an order, the shipping cost is not getting calculated automatically.. and so we are having to manually enter the shipping cost..this is happening only for Apac regions. for all other regions it seems to be working. but the shipping cost is getting calculated in R/3. can anyone provide input for this?
    Also, what factors determine the shipping cost?
    Thanks,
    Preethy

    This is a funtional issue... You'll be better of opening this message in the right Area.... or open an OSS message for SAP.
    Regards
    Juan

  • Reg :Production order cost  report day wise.

    Dear Expert,
    1.We want a report for a particular Production order cost  day wise.
    The scenario is like this Production order is Released for 100 Qty.
    Today they confirmed only 50 Qty.
    Tomorrow they will confirm 50 qty.
    Now they want to see the cost for today confirmation and tomorrows confirmation.
    Reason being daily the Raw Material cost is changed and they want to track the variance.
    Is there any standard report we can achieve this or do we have go for development
    2. And also i need to know daily how many production orders have been released.
    Thank u in advance.

    A day is not a controlled cost object. You could write a report to look at costs gathered in a day (by reporting date), but I strongly suggest that if you need to analyze costs per day you switch to daily orders.
    You'll find then that all the standard processes work for you.

Maybe you are looking for

  • ATG 9.4 installation problem with weblogic 10.0.2 MP2

    Hi, I am new in ATG platform and framework. I am trying to install ATG 9.4 on BEA Weblogic 10.0.2 on Windows desktop with the help of Installation guide for ATG. I have completed installation of BEA Weblogic 10.0.2 and then ATG 9.4, giving the correc

  • Unwanted Invitations when adding or editing events

    Whenever I add or edit an event in my calendar, I get an invitation on my iPhone but not my iPad.  I'm running 6.1.2 on both devices.  This happens regardless of whether I change an event on my iMac or my iPhone or my iPad.  My husband keeps the hous

  • Disco Viewer is slow - Maybe drilling data?

    I have a Worksheet which when run in Disco Desktop runs and displays in about 1.5 seconds. When I run it in Viewer it takes 4 seconds to get as far as displaying the title of the report and then a further 50 seconds before the main body of data appea

  • My album purchase was interrupted and when I go to recent purchases it won't let me download the rest of the album

    I can see my songs in the "purchased" and I see a download arrow but when I click it and enter my password, nothing happens. Same thing with DOWNLOAD ALL button...it prompts me for user  name and password, but nothing happens after I do that. Please

  • ITunes creates duplicates when Adding a Folder

    Lately, whenever I add a folder to iTunes it creates a duplicate of each song. I have to go in and delete each occurance -- very irritating. I have the Sound Check volume adjuster in Preferences enabled. Maybe it has something to do with that. Any id