Join Performance in Detail

Hi all,
I have a special question for the performance of the join statement. Can anyone explain me how the join really works. If I have a SELECT Statement like the following:
SELECT MARA~MATNR
       MARC~WEKRS
  FROM MARA JOIN MARC
    ON (MARAMATNR = MARCMATNR)
WHERE MARC~MMSTA = 01
ORDER BY MARC~WERKS.
In my example MARC has 1.000.000 entries and MARA has 200.000 . Can someone explain which is done first? I think first he made the join means, he creates a temp table with 1.000.000 entries, when delete all that do not match the SELECT Clause and than make the ORDER BY. But I am not really sure, so maybe someone can help me.
Thanks,
  Chris

Make a report with your select and check the time elapsed, then repeat changing the order of your tables in the FROM section, it will answer your question.
IMO, it will depend of your DB server. But with the few things I learned about SAP and ABAP, I think it will be faster (more memory needed, but) using internal tables.
Fill your itab_marc first, filtering the 1000k registers and loop it. If you do the insertions in your itabs using ORDER BY clause SQL, the result will be fast.
Maybe it doesn't help, but if you do it, post the results
Regards,
Vic
SELECT *
  FROM MARC
  INTO TABLE it_marc
  WHERE MMSTA = 01
  ORDER BY MATNR.
SELECT *
  FROM MARA
  INTO TABLE it_mara
  ORDER BY MATNR.
loop it_marc.
  loop it_mara.
    if it_mara-matnr = it_marc-matnr.
    endif.
  endloop.
endloop.
My doubt: if you use nested loops... the nested one will be restarted for each iteration of the first one??
If it is, you can improve the speed making a delete in it_mara where matnr < it_marc-matnr.

Similar Messages

  • Text joins performance impact

    Hello,
    We are building a huge calculation view which in the end will have ~1000 fields. This calculation view will be built from several smaller calculation views with union between them. Each small calculation view uses Analytical view that in the logical join uses attribute view with text join.
    One of my big concerns is where should we add the text fields to this view? It will expand the number of fields in 30%.Maybe we should have these smaller joins in the BO IDT level.. When I try to check the performance in the viso plan (in smaller model..) I can see that  the text joins are only performed when we ask for text. What do you think? Will calculation view with ~1000 fields will work? Will it make any diferent if we add the texts to our model?
    Should we add the text joins in the analytical view Data Foundation or Logical join?
    Thanks,
    Amir

    That's a correct observation.
    Like the dynamic and the referential join, text joins are only executed when the joined columns are actually requested.
    Therefore, I would go on and model the text "where it belongs" in your view hierarchy.
    If and only if you find that there is a performance problem and you can pin it down to exactly the text joins, then I would dig deeper.
    - Lars

  • Key Performance Indicators details

    could anyone specify about the details on Key Performance Indicators ,their extraction and other related details

    KPIs (Key Performance Indicators) are Key Figures: quantities, amounts, percentages... etc.
    They are just key figures with a combination of chars will just be extracted and stored.
    They can be related to queries, data loads or sometimes realted to business logic of the client.
    They receive that name in the business side because they reflect the performance of a specific company...
    Normally KPI is used for the "core" indicators, like profit, loss, costs, etc.some examples are
    1. no of cost centres that spent more than the budget last month.
    2. no of projects that got finished on schedule.
    Now, depending on the area for which you want to analyze the KPIs, you have different ways to extract the data: Logistics, Inventory, Finance, etc.KPIs will have to be defined.
    Give me details of which KPI u needed.. i will give you more information then

  • Performance Transactions & Details

    Hai All,
    I am Farooq, the only individual for a Company working on ABAP from about 3 months. Please let me know all the details with Transactions of Performance Tuning, SQL Trace, & different other Traces.
    Now I have come across  <b>ST01, ST02, ST03, ST04, ST05, ST06, ST07, ST11, ST14, ST20, ST22, ST30, ST33, ST35, ST36, ST37, ST62</b>. I am hardly aware of anything in these. I know little about <b>ST05</b> only & very interested to learn much more.
    May be explaining all these may take much time & is not Possible here. So its OK even if U take your own time & send across any documents or mails to my ID, "[email protected]" when u r free. I would be very thankful to U. <b>THANKS a lot</b> in advance.
    Best Regards & wishes.
    Farooq

    Farooq,
    You can use SE30 for doing run time analysis of what is going on in the program which part has taken how much time .
    What is the data base time and what is program run time all details are available in this transaction.
    Using ST05 u can identfy which table is taking time to query, What index it is using .. by this we can decide to do secondary indexing in the table .
    At times it will also be neceesary from Basis side to re-build the index, re-build the statistics tables which will also improvise the performance .
    I will send u doucment  on performance tuning for programming.
    Regards
    R. Ramvelu
    [email protected]

  • User Defined Function VS join - Performance....

    Hi All,
    while linking the mulitple table and getting the values ....which one is the best ?
    Joining or User defined function.....
    single row function
    select a.name , get_salary(empid) from emp a;
    Note : get_salary function will return the salary from salary tables.
    Using joins
    select a.name ,b.salary from emp a, salary b
    where a.empid=b.empid;
    which is the performancewise best ?
    also if you give any related document also fine.
    Thanks in advance.
    Edited by: BASKAR NATARAJAN on Jan 6, 2011 10:09 PM

    Don't use such functions for joins. The function itself has to query the salary table. It will run the query against the salary table separately for each row that it reads from the emp table. You will end up with multiple recursive calls and possibly inconsistency in the output. (Imagine what would happen if the salary table were updated and commited while this query was running -- some rows would have been read with the pre-update values and others with the updated values).
    Specifying the join in the query ensures that a single SQL call is executed and provides read consistency across all the rows it reads. And it is much faster, being one single parse and execute.
    Hemant K Chitale
    http://hemantoracledba.blogspot.com

  • Outer Join Performance Issue

    Dear All,
    Please help me in tuning the below query as it is including the outer join and is going for full table scans.
    Query :
    SELECT
    T27.CONFLICT_ID,
    T27.LAST_UPD,
    T27.CREATED,
    T27.LAST_UPD_BY,
    T27.CREATED_BY,
    T27.MODIFICATION_NUM,
    T27.ROW_ID,
    T24.ATTRIB_39,
    T27.REMIT_ADDR_ORG_ID,
    T27.REMIT_ORG_EXT_ID,
    T16.NAME,
    T25.ACCNT_TYPE_CD,
    T27.RECAL_TAX_SRV_FLG,
    T27.PROJ_ID,
    T8.PROJ_NUM,
    T8.BU_ID,
    T5.NAME,
    T8.INTEGRATION_ID,
    T12.CURCY_CD,
    T25.PR_BL_ADDR_ID,
    T25.URL,
    T27.TTL_INVC_AMT,
    T27.INVC_TYPE_CD,
    T27.TTL_PD_AMT,
    T3.CG_ASSSET_ID,
    T17.ASSET_NUM,
    T27.VENDR_INVOICE_NUM,
    T4.TOT_QTY_SHIP,
    T4.TOT_EXTND_PRICE,
    T27.ACCNT_ID,
    T25.INTEGRATION_ID,
    T25.NAME,
    T25.BU_ID,
    T25.AVAIL_CREDIT_AMT,
    T10.NAME,
    T27.AGREEMENT_ID,
    T4.TOT_EXTND_TAX,
    T27.STMT_SOURCE_CD,
    T4.SRC_INVLOC_ID,
    T27.STATUS_CD,
    T4.TOT_QTY_BONUS,
    T27.X_DEPOSIT_AMT,
    T27.COMMENTS,
    T27.INVC_FULLY_PAID_DT,
    T26.SEQ_NUM,
    T27.ELEMENT_ID,
    T26.INSCLM_ID,
    T14.INSCLAIM_NUM,
    T27.BL_PER_ID,
    T27.INS_CLAIM_ID,
    T27.FN_ACCNT_ID,
    T27.CUSTOMER_REF_NUM,
    T27.TTL_NONREC_AMT,
    T25.OU_NUM,
    T24.ATTRIB_39,
    T27.AMT_CURCY_CD,
    T2.CCNUM_ENCRPKEY_REF,
    T18.PR_DEPOSIT_ID,
    T19.DISCNT_RULE_CD,
    T27.ORDER_ID,
    T4.STATUS_CHG_FLG,
    T25.MAIN_PH_NUM,
    T25.MAIN_FAX_PH_NUM,
    T27.DELINQUENT_FLG,
    T15.LOGIN,
    T25.PR_POSTN_ID,
    T4.ORDER_NUM,
    T22.ADDR,
    T22.ZIPCODE,
    T27.INVC_NUM,
    T27.INVC_DT,
    T22.COUNTRY,
    T22.CITY,
    T27.BL_ADDR_ID,
    T23.NAME,
    T27.POSTED_DT,
    T20.NAME,
    T27.BL_PERIOD_ID,
    T27.GOODS_DLVRD_TS,
    T23.NET_DAYS,
    T27.PAYMENT_TERM_ID,
    T23.DUE_DT,
    T27.DUE_DT,
    T27.VOID_REASON_TEXT,
    T27.DEPT_CD,
    T24.ATTRIB_60,
    T24.ATTRIB_28,
    T21.AMT,
    T1.STATE,
    T1.ADDR,
    T1.ADDR_LINE_2,
    T1.COUNTRY,
    T1.CITY,
    T1.ZIPCODE,
    T11.LOGIN,
    T21.ROW_ID,
    T9.ROW_ID,
    T1.ROW_ID,
    T13.ROW_ID,
    T7.ROW_ID
    FROM
    SIEBEL.S_ADDR_PER T1,
    SIEBEL.S_PTY_PAY_PRFL T2,
    SIEBEL.S_INVLOC T3,
    SIEBEL.S_ORDER T4,
    SIEBEL.S_ORG_EXT T5,
    SIEBEL.S_POSTN T6,
    SIEBEL.S_PARTY T7,
    SIEBEL.S_PROJ T8,
    SIEBEL.S_CON_ADDR T9,
    SIEBEL.S_ORG_EXT T10,
    SIEBEL.S_USER T11,
    SIEBEL.S_DOC_QUOTE T12,
    SIEBEL.S_ACCNT_POSTN T13,
    SIEBEL.S_INS_CLAIM T14,
    SIEBEL.S_USER T15,
    SIEBEL.S_ORG_EXT T16,
    SIEBEL.S_ASSET T17,
    SIEBEL.S_ORDER_TNTX T18,
    SIEBEL.S_ORG_EXT_TNTX T19,
    SIEBEL.S_PERIOD T20,
    SIEBEL.S_DEPOSIT_TNT T21,
    SIEBEL.S_ADDR_PER T22,
    SIEBEL.S_PAYMENT_TERM T23,
    SIEBEL.S_ORG_EXT_X T24,
    SIEBEL.S_ORG_EXT T25,
    SIEBEL.S_INSCLM_ELMNT T26,
    SIEBEL.S_INVOICE T27
    WHERE
    T25.BU_ID = T10.PAR_ROW_ID (+) AND
    T26.INSCLM_ID = T14.ROW_ID (+) AND
    T27.ELEMENT_ID = T26.ROW_ID (+) AND
    T27.LAST_UPD_BY = T15.PAR_ROW_ID (+) AND
    T4.QUOTE_ID = T12.ROW_ID (+) AND
    T3.CG_ASSSET_ID = T17.ROW_ID (+) AND
    T27.BL_ADDR_ID = T22.ROW_ID (+) AND
    T8.BU_ID = T5.PAR_ROW_ID (+) AND
    T27.PER_PAY_PRFL_ID = T2.ROW_ID (+) AND
    T27.REMIT_ORG_EXT_ID = T16.PAR_ROW_ID (+) AND
    T27.PROJ_ID = T8.ROW_ID (+) AND
    T27.BL_PERIOD_ID = T20.ROW_ID (+) AND
    T27.PAYMENT_TERM_ID = T23.ROW_ID (+) AND
    T12.BU_ID = T19.PAR_ROW_ID (+) AND
    T27.ACCNT_ID = T25.PAR_ROW_ID (+) AND
    T27.ORDER_ID = T18.ROW_ID (+) AND
    T4.SRC_INVLOC_ID = T3.ROW_ID (+) AND
    T27.ORDER_ID = T4.ROW_ID (+) AND
    T27.ACCNT_ID = T24.PAR_ROW_ID (+) AND
    T18.PR_DEPOSIT_ID = T21.ROW_ID (+) AND
    T27.BL_ADDR_ID = T9.ADDR_PER_ID (+) AND
    T27.ACCNT_ID = T9.ACCNT_ID (+) AND
    T27.BL_ADDR_ID = T1.ROW_ID (+) AND
    T25.PR_POSTN_ID = T13.POSITION_ID (+) AND
    T25.ROW_ID = T13.OU_EXT_ID (+) AND
    T13.POSITION_ID = T7.ROW_ID (+) AND
    T13.POSITION_ID = T6.PAR_ROW_ID (+) AND
    T6.PR_EMP_ID = T11.PAR_ROW_ID (+) AND
    (T27.INVC_TYPE_CD = :1) AND
    (T27.DEPT_CD = :2);
    Explan Plan Output :
    PLAN_TABLE_OUTPUT
    Plan hash value: 3132260827
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 1958 | 1896K (11)| 00:50:46 |
    | 1 | NESTED LOOPS OUTER | | 1 | 1958 | 1896K (11)| 00:50:46 |
    | 2 | NESTED LOOPS OUTER | | 1 | 1922 | 1896K (11)| 00:50:46 |
    | 3 | NESTED LOOPS OUTER | | 1 | 1885 | 1896K (11)| 00:50:46 |
    | 4 | NESTED LOOPS OUTER | | 1 | 1861 | 1896K (11)| 00:50:46 |
    | 5 | NESTED LOOPS OUTER | | 1 | 1849 | 1896K (11)| 00:50:46 |
    | 6 | NESTED LOOPS OUTER | | 1 | 1817 | 1896K (11)| 00:50:46 |
    | 7 | NESTED LOOPS OUTER | | 1 | 1792 | 1896K (11)| 00:50:46 |
    | 8 | NESTED LOOPS OUTER | | 1 | 1771 | 1896K (11)| 00:50:46 |
    | 9 | NESTED LOOPS OUTER | | 1 | 1739 | 1896K (11)| 00:50:46 |
    | 10 | NESTED LOOPS OUTER | | 1 | 1483 | 1896K (11)| 00:50:46 |
    | 11 | NESTED LOOPS OUTER | | 1 | 1451 | 1896K (11)| 00:50:46 |
    | 12 | NESTED LOOPS OUTER | | 1 | 1419 | 1896K (11)| 00:50:46 |
    | 13 | NESTED LOOPS OUTER | | 1 | 1361 | 1896K (11)| 00:50:46 |
    | 14 | NESTED LOOPS OUTER | | 1 | 1276 | 1896K (11)| 00:50:46 |
    | 15 | NESTED LOOPS OUTER | | 1 | 1202 | 1896K (11)| 00:50:46 |
    | 16 | NESTED LOOPS OUTER | | 1 | 1108 | 1896K (11)| 00:50:46 |
    | 17 | NESTED LOOPS OUTER | | 1 | 1087 | 1896K (11)| 00:50:46 |
    | 18 | NESTED LOOPS OUTER | | 1 | 1040 | 1896K (11)| 00:50:46 |
    | 19 | NESTED LOOPS OUTER | | 1 | 939 | 1896K (11)| 00:50:46 |
    | 20 | NESTED LOOPS OUTER | | 1 | 894 | 1896K (11)| 00:50:46 |
    | 21 | NESTED LOOPS OUTER | | 1 | 868 | 1896K (11)| 00:50:46 |
    | 22 | NESTED LOOPS OUTER | | 1 | 843 | 1896K (11)| 00:50:46 |
    | 23 | NESTED LOOPS OUTER | | 1 | 824 | 1896K (11)| 00:50:46 |
    | 24 | NESTED LOOPS OUTER | | 1 | 690 | 1896K (11)| 00:50:46 |
    | 25 | NESTED LOOPS OUTER | | 1 | 613 | 1896K (11)| 00:50:46 |
    | 26 | NESTED LOOPS OUTER | | 1 | 457 | 1896K (11)| 00:50:46 |
    |* 27 | TABLE ACCESS FULL | S_INVOICE | 1 | 269 | 1896K (11)| 00:50:46 |
    | 28 | TABLE ACCESS BY INDEX ROWID| S_PROJ | 1 | 188 | 1 (0)| 00:00:01 |
    |* 29 | INDEX UNIQUE SCAN | S_PROJ_P1 | 1 | | 1 (0)| 00:00:01 |
    | 30 | TABLE ACCESS BY INDEX ROWID | S_PAYMENT_TERM | 1 | 156 | 1 (0)| 00:00:01 |
    |* 31 | INDEX UNIQUE SCAN | S_PAYMENT_TERM_P1 | 1 | | 1 (0)| 00:00:01 |
    | 32 | TABLE ACCESS BY INDEX ROWID | S_INSCLM_ELMNT | 1 | 77 | 1 (0)| 00:00:01 |
    |* 33 | INDEX UNIQUE SCAN | S_INSCLM_ELMNT_P1 | 1 | | 1 (0)| 00:00:01 |
    | 34 | TABLE ACCESS BY INDEX ROWID | S_INS_CLAIM | 1 | 134 | 1 (0)| 00:00:01 |
    |* 35 | INDEX UNIQUE SCAN | S_INS_CLAIM_P1 | 1 | | 1 (0)| 00:00:01 |
    | 36 | TABLE ACCESS BY INDEX ROWID | S_PERIOD | 1 | 19 | 1 (0)| 00:00:01 |
    |* 37 | INDEX UNIQUE SCAN | S_PERIOD_P1 | 1 | | 1 (0)| 00:00:01 |
    | 38 | TABLE ACCESS BY INDEX ROWID | S_USER | 1 | 25 | 2 (0)| 00:00:01 |
    |* 39 | INDEX UNIQUE SCAN | S_USER_U2 | 1 | | 1 (0)| 00:00:01 |
    | 40 | TABLE ACCESS BY INDEX ROWID | S_ORDER_TNTX | 1 | 26 | 2 (0)| 00:00:01 |
    |* 41 | INDEX UNIQUE SCAN | S_ORDER_TNTX_P1 | 1 | | 1 (0)| 00:00:01 |
    | 42 | TABLE ACCESS BY INDEX ROWID | S_DEPOSIT_TNT | 1 | 45 | 1 (0)| 00:00:01 |
    |* 43 | INDEX UNIQUE SCAN | S_DEPOSIT_TNT_P1 | 1 | | 1 (0)| 00:00:01 |
    | 44 | TABLE ACCESS BY INDEX ROWID | S_ORDER | 1 | 101 | 2 (0)| 00:00:01 |
    |* 45 | INDEX UNIQUE SCAN | S_ORDER_P1 | 1 | | 1 (0)| 00:00:01 |
    | 46 | TABLE ACCESS BY INDEX ROWID | S_INVLOC | 1 | 47 | 1 (0)| 00:00:01 |
    |* 47 | INDEX UNIQUE SCAN | S_INVLOC_P1 | 1 | | 1 (0)| 00:00:01 |
    | 48 | TABLE ACCESS BY INDEX ROWID | S_DOC_QUOTE | 1 | 21 | 1 (0)| 00:00:01 |
    |* 49 | INDEX UNIQUE SCAN | S_DOC_QUOTE_P1 | 1 | | 1 (0)| 00:00:01 |
    | 50 | TABLE ACCESS BY INDEX ROWID | S_ORG_EXT_TNTX | 1 | 94 | 1 (0)| 00:00:01 |
    |* 51 | INDEX RANGE SCAN | S_ORG_EXT_TNTX_U1 | 1 | | 1 (0)| 00:00:01 |
    | 52 | TABLE ACCESS BY INDEX ROWID | S_PTY_PAY_PRFL | 1 | 74 | 1 (0)| 00:00:01 |
    |* 53 | INDEX UNIQUE SCAN | S_PTY_PAY_PRFL_P1 | 1 | | 1 (0)| 00:00:01 |
    | 54 | TABLE ACCESS BY INDEX ROWID | S_ADDR_PER | 1 | 85 | 2 (0)| 00:00:01 |
    |* 55 | INDEX UNIQUE SCAN | S_ADDR_PER_P1 | 1 | | 1 (0)| 00:00:01 |
    | 56 | TABLE ACCESS BY INDEX ROWID | S_ADDR_PER | 1 | 58 | 1 (0)| 00:00:01 |
    |* 57 | INDEX UNIQUE SCAN | S_ADDR_PER_P1 | 1 | | 1 (0)| 00:00:01 |
    | 58 | TABLE ACCESS BY INDEX ROWID | S_ORG_EXT | 1 | 32 | 1 (0)| 00:00:01 |
    |* 59 | INDEX UNIQUE SCAN | S_ORG_EXT_U3 | 1 | | 1 (0)| 00:00:01 |
    | 60 | TABLE ACCESS BY INDEX ROWID | S_ORG_EXT | 1 | 32 | 1 (0)| 00:00:01 |
    |* 61 | INDEX UNIQUE SCAN | S_ORG_EXT_U3 | 1 | | 1 (0)| 00:00:01 |
    | 62 | TABLE ACCESS BY INDEX ROWID | S_ORG_EXT | 1 | 256 | 2 (0)| 00:00:01 |
    |* 63 | INDEX UNIQUE SCAN | S_ORG_EXT_U3 | 1 | | 1 (0)| 00:00:01 |
    | 64 | TABLE ACCESS BY INDEX ROWID | S_ACCNT_POSTN | 1 | 32 | 3 (0)| 00:00:01 |
    |* 65 | INDEX RANGE SCAN | S_ACCNT_POSTN_U1 | 1 | | 2 (0)| 00:00:01 |
    | 66 | TABLE ACCESS BY INDEX ROWID | S_POSTN | 1 | 21 | 1 (0)| 00:00:01 |
    |* 67 | INDEX UNIQUE SCAN | S_POSTN_U2 | 1 | | 1 (0)| 00:00:01 |
    | 68 | TABLE ACCESS BY INDEX ROWID | S_USER | 1 | 25 | 2 (0)| 00:00:01 |
    |* 69 | INDEX UNIQUE SCAN | S_USER_U2 | 1 | | 1 (0)| 00:00:01 |
    | 70 | TABLE ACCESS BY INDEX ROWID | S_ORG_EXT | 1 | 32 | 2 (0)| 00:00:01 |
    |* 71 | INDEX UNIQUE SCAN | S_ORG_EXT_U3 | 1 | | 1 (0)| 00:00:01 |
    |* 72 | INDEX UNIQUE SCAN | S_PARTY_P1 | 1 | 12 | 1 (0)| 00:00:01 |
    | 73 | TABLE ACCESS BY INDEX ROWID | S_ASSET | 1 | 24 | 2 (0)| 00:00:01 |
    |* 74 | INDEX UNIQUE SCAN | S_ASSET_P1 | 1 | | 2 (0)| 00:00:01 |
    | 75 | TABLE ACCESS BY INDEX ROWID | S_ORG_EXT_X | 1 | 37 | 2 (0)| 00:00:01 |
    |* 76 | INDEX RANGE SCAN | S_ORG_EXT_X_U1 | 1 | | 2 (0)| 00:00:01 |
    | 77 | TABLE ACCESS BY INDEX ROWID | S_CON_ADDR | 1 | 36 | 3 (0)| 00:00:01 |
    |* 78 | INDEX RANGE SCAN | S_CON_ADDR_U1 | 1 | | 2 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    27 - filter("T27"."DEPT_CD"=:2 AND "T27"."INVC_TYPE_CD"=:1)
    29 - access("T27"."PROJ_ID"="T8"."ROW_ID"(+))
    31 - access("T27"."PAYMENT_TERM_ID"="T23"."ROW_ID"(+))
    33 - access("T27"."ELEMENT_ID"="T26"."ROW_ID"(+))
    35 - access("T26"."INSCLM_ID"="T14"."ROW_ID"(+))
    37 - access("T27"."BL_PERIOD_ID"="T20"."ROW_ID"(+))
    39 - access("T27"."LAST_UPD_BY"="T15"."PAR_ROW_ID"(+))
    41 - access("T27"."ORDER_ID"="T18"."ROW_ID"(+))
    43 - access("T18"."PR_DEPOSIT_ID"="T21"."ROW_ID"(+))
    45 - access("T27"."ORDER_ID"="T4"."ROW_ID"(+))
    47 - access("T4"."SRC_INVLOC_ID"="T3"."ROW_ID"(+))
    49 - access("T4"."QUOTE_ID"="T12"."ROW_ID"(+))
    51 - access("T12"."BU_ID"="T19"."PAR_ROW_ID"(+))
    53 - access("T27"."PER_PAY_PRFL_ID"="T2"."ROW_ID"(+))
    55 - access("T27"."BL_ADDR_ID"="T1"."ROW_ID"(+))
    57 - access("T27"."BL_ADDR_ID"="T22"."ROW_ID"(+))
    59 - access("T8"."BU_ID"="T5"."PAR_ROW_ID"(+))
    61 - access("T27"."REMIT_ORG_EXT_ID"="T16"."PAR_ROW_ID"(+))
    63 - access("T27"."ACCNT_ID"="T25"."PAR_ROW_ID"(+))
    65 - access("T25"."ROW_ID"="T13"."OU_EXT_ID"(+) AND "T25"."PR_POSTN_ID"="T13"."POSITION_ID"(+))
    67 - access("T13"."POSITION_ID"="T6"."PAR_ROW_ID"(+))
    69 - access("T6"."PR_EMP_ID"="T11"."PAR_ROW_ID"(+))
    71 - access("T25"."BU_ID"="T10"."PAR_ROW_ID"(+))
    72 - access("T13"."POSITION_ID"="T7"."ROW_ID"(+))
    74 - access("T3"."CG_ASSSET_ID"="T17"."ROW_ID"(+))
    76 - access("T27"."ACCNT_ID"="T24"."PAR_ROW_ID"(+))
    78 - access("T27"."BL_ADDR_ID"="T9"."ADDR_PER_ID"(+) AND "T27"."ACCNT_ID"="T9"."ACCNT_ID"(+))
    filter("T27"."ACCNT_ID"="T9"."ACCNT_ID"(+))
    117 rows selected.
    We are using 10.2.0.3 oracle version.

    Hi
    according to the explain plan, > 99% of the cost of the query is coming from a single operation -- step 27, full scan of S_INVOICE table.
    This probably means that there are no usable indexes on DEPT_CD and/or INVC_TYPE_CD.
    So start by tuning SELECT * FROM S_INVOICE T27 WHERE ("T27"."DEPT_CD"=:2 AND "T27"."INVC_TYPE_CD"=:1)
    BTW the plan shows that 1 row is to be returned, while Oracle actually returns 117 -- this means that the optimizer estimates are not very reliable here.
    Best regards,
    Nikolay

  • ANSI SQL 92 SYNTAX OUTER JOIN PERFORMANCE ISSUE

    Good Morning
    Could anyone explain why the excution time for these two (ment to be identical)
    queries run so differently.
    oracle syntax execution time 1.06 seconds
    select COUNT(*) from
    PL_EVENT_VIEW pev,
    PL_EVENT_STAFF_VIEW pesv
    WHERE pev.EVENT_ID=PESV.EVENT_ID(+)
    AND pev.WEEKS=PESV.WEEK_NUM(+)
    AND pev.event_id=2520
    ansi sql 92 syntax execution time 7.05 seconds
    select COUNT(*) from
    PL_EVENT_VIEW pev
    LEFT JOIN PL_EVENT_STAFF_VIEW pesv
    ON (pev.EVENT_ID=PESV.EVENT_ID
    AND pev.WEEKS=PESV.WEEK_NUM)
    WHERE pev.event_id=2520
    Thanks
    David Hills

    BTW Oracle outer join operator (+) and ANSI SQL OUTER JOIN syntax are NOT equivalent. Consider following:
    DROP TABLE T1;
    CREATE TABLE T1 (C1 NUMBER);
    DROP TABLE T2;
    CREATE TABLE T2 (C2 NUMBER);
    DROP TABLE T3;
    CREATE TABLE T3 (C3 NUMBER);
    -- Following SELECT works:
    SELECT COUNT(*)
         FROM T1, T2, T3
         WHERE C2 = C1
              AND C3(+) = C1
    COUNT(*)
    0
    -- But:
    SELECT COUNT(*)
         FROM T1, T2, T3
         WHERE C2 = C1
              AND C3(+) = C1
              AND C3(+) = C2
    AND C3(+) = C1
    ERROR at line 4:
    ORA-01417: a table may be outer joined to at most one other table
    -- However with ANSI syntax:
    SELECT COUNT(*)
         FROM T1
         JOIN T2 ON (C2 = C1)
         LEFT JOIN T3 ON (C3 = C1 AND C3 = C2)
    COUNT(*)
    0

  • Join between Header & Detail tables based on age and group

    To find the age & group  amount in detail table based on  age & group_id in header ?
    Example: Let's take the seq_id =1 from header,it has age= 60 & group_id=23 (23 Months).
    In the detail table xx_detail,the age column represents the age of the person (0-65 represents the age in between 0 to 65 and so on).
    If the age is null,then that row indicates the group (0-12 represents the group in between 0 to 12 months ).If the age is not null,then the group1,group2,group3 have the amounts data.
    So Now i have to get the amount as 240(as my header seq_id=1,age=60,group_id=23 as it falls under 0-65 age & 13-59 group ).So i need a sql query to find the correct amount in detail based on header record. We have to pass the parameters age & group_id and get the amount from detail tables.Can anyone provide inputs how to achive this in the simplest way.
    SQL> select * from v$version  
      2  /  
    BANNER  
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production  
    PL/SQL Release 11.2.0.3.0 - Production  
    CORE    11.2.0.3.0      Production  
    TNS for Linux: Version 11.2.0.3.0 - Production  
    NLSRTL Version 11.2.0.3.0 - Production  
    SQL> desc xx_header;  
    Name                                      Null?    Type  
    SEQ_ID                                             VARCHAR2(6)  
    AGE                                                NUMBER  
    START_DATE                                         DATE 
    GROUP_ID                                           NUMBER  
    SQL> select * from xx_header;  
    SEQ_ID        AGE START_DATE   GROUP_ID  
    1               60      01-JAN-12            23  
    2               89      01-JAN-12            23  
    3               95      01-JAN-12            23  
    SQL> desc xx_detail;  
    Name                                       Null?    Type  
    SEQ_ID                                              VARCHAR2(10)  
    AGE                                                   VARCHAR2(10)  
    GROUP1                                             VARCHAR2(10)  
    GROUP2                                             VARCHAR2(10)  
    GROUP3                                             VARCHAR2(10)  
    SQL> select * from xx_detail;  
    SEQ_ID     AGE        GROUP1     GROUP2     GROUP3  
    1                                0-12              13-59       60-126  
    1           0-65               120                 240         300  
    1          66-135             100                 80          400

    Hi,
    Is this the same question that you asked 3 days ago
    https://forums.oracle.com/thread/2606197
    Whether it is or not, post the information requested in that message, which is also listed in the Forum FAQ:
    https://forums.oracle.com/message/9362002
    If it is the same question, don't post a new thread.  Mark this thread as "Answered" right away, and continue in the original thread.

  • How to join to column details to get desired output

    Kindly refer the attached queries namely
    1)REORDER
    2)PENDING WORKORDER
    I want to calculate the work order requirement on basis of
    Stock, Pending sales order, re-order level and already entered workorders. Now i want to add the first column of 2nd query in the report of 1st query. For that i tried the below statements
    AND ITEM_CODE = LCS_ITEM_CODE (+)
    AND ITEM_CODE = SOI_ITEM_CODE (+)
    AND ITEM_CODE = PWH_ITEM_CODE (+)
    LCS_ITEM_CODE is Stock table item_code,
    SOI_ITEM_CODE is Sales order item_code,
    PWH_ITEM_CODE is Production work order item_code,
    When the above statments used while combining the 2 queries does display the result, but the details comes only for the ietm_codes whose work orders are present.
    Kindly guide me how can i get the desired output.
    1)RE-ORDER QUERY :
    SELECT DISTINCT ITEM_CODE,
    ITEM_NAME,
    (CASE
    WHEN SUBSTR(ITEM_CODE,11,3) = '000' THEN 'LOOSE'
    ELSE SUBSTR(ITEM_CODE,11,4)
    END) PKG_SIZE,
    ((LCS_STK_QTY_BU + LCS_RCVD_QTY_BU - LCS_ISSD_QTY_BU) / IU_MAX_LOOSE_1) * TO_NUMBER(SUBSTR(ITEM_CODE,- 3,3))
    ||DECODE(SUBSTR(LCS_ITEM_CODE,11,3),'000',((LCS_STK_QTY_BU + LCS_RCVD_QTY_BU - LCS_ISSD_QTY_BU) / IU_MAX_LOOSE_1)) STOCK,
    (CASE
    WHEN SUM(TO_NUMBER(SOI_QTY
    ||'.'
    ||SOI_QTY_LS) - (SOI_INVI_QTY_BU / IU_CONV_FACTOR / IU_MAX_LOOSE_1)) < 0 THEN 0
    ELSE SUM(TO_NUMBER(SOI_QTY
    ||'.'
    ||SOI_QTY_LS) - (SOI_INVI_QTY_BU / IU_CONV_FACTOR / IU_MAX_LOOSE_1))
    END) PNDG,
    ((LCS_STK_QTY_BU + LCS_RCVD_QTY_BU - LCS_ISSD_QTY_BU) / IU_MAX_LOOSE_1) * TO_NUMBER(SUBSTR(ITEM_CODE,- 3,3))
    ||DECODE(SUBSTR(LCS_ITEM_CODE,11,3),'000',((LCS_STK_QTY_BU + LCS_RCVD_QTY_BU - LCS_ISSD_QTY_BU) / IU_MAX_LOOSE_1)) - SUM(TO_NUMBER(SOI_QTY
    ||'.'
    ||SOI_QTY_LS) - (SOI_INVI_QTY_BU / IU_CONV_FACTOR / IU_MAX_LOOSE_1)) NETSTK,
    ITEM_RORD_LVL REORD_LVL,
    (CASE
    WHEN ((LCS_STK_QTY_BU + LCS_RCVD_QTY_BU - LCS_ISSD_QTY_BU) / IU_MAX_LOOSE_1) * TO_NUMBER(SUBSTR(ITEM_CODE,- 3,3))
    ||DECODE(SUBSTR(LCS_ITEM_CODE,11,3),'000',((LCS_STK_QTY_BU + LCS_RCVD_QTY_BU - LCS_ISSD_QTY_BU) / IU_MAX_LOOSE_1)) - SUM(TO_NUMBER(SOI_QTY
    ||'.'
    ||SOI_QTY_LS) - (SOI_INVI_QTY_BU / IU_CONV_FACTOR / IU_MAX_LOOSE_1)) > 0
    AND ITEM_RORD_LVL > 0 THEN ((LCS_STK_QTY_BU + LCS_RCVD_QTY_BU - LCS_ISSD_QTY_BU) / IU_MAX_LOOSE_1) * TO_NUMBER(SUBSTR(ITEM_CODE,- 3,3))
    ||DECODE(SUBSTR(LCS_ITEM_CODE,11,3),'000',((LCS_STK_QTY_BU + LCS_RCVD_QTY_BU - LCS_ISSD_QTY_BU) / IU_MAX_LOOSE_1)) - SUM(TO_NUMBER(SOI_QTY
    ||'.'
    ||SOI_QTY_LS) - (SOI_INVI_QTY_BU / IU_CONV_FACTOR / IU_MAX_LOOSE_1))
    ELSE NVL(ITEM_RORD_LVL,0) - (((LCS_STK_QTY_BU + LCS_RCVD_QTY_BU - LCS_ISSD_QTY_BU) / IU_MAX_LOOSE_1) * TO_NUMBER(SUBSTR(ITEM_CODE,- 3,3))
    ||DECODE(SUBSTR(LCS_ITEM_CODE,11,3),'000',((LCS_STK_QTY_BU + LCS_RCVD_QTY_BU - LCS_ISSD_QTY_BU) / IU_MAX_LOOSE_1)) - SUM(TO_NUMBER(SOI_QTY
    ||'.'
    ||SOI_QTY_LS) - (SOI_INVI_QTY_BU / IU_CONV_FACTOR / IU_MAX_LOOSE_1)))
    END) REQ,
    DECODE(ITEM_RORD_QTY_LS,NULL,ITEM_RORD_QTY,
    (ITEM_RORD_QTY
    ||'.'
    ||ITEM_RORD_QTY_LS)) BTCHSZE
    FROM OM_ITEM,
    OT_SO_HEAD,
    OT_SO_ITEM,
    OM_ITEM_UOM,
    OS_LOCN_CURR_STK
    WHERE (ITEM_UOM_CODE = IU_UOM_CODE
    AND ITEM_CODE = IU_ITEM_CODE)
    AND ITEM_CODE = LCS_ITEM_CODE (+)
    AND ITEM_CODE = SOI_ITEM_CODE (+)
    AND LCS_LOCN_CODE = 'FG'
    AND LCS_ITEM_CODE = SOI_ITEM_CODE
    AND SOI_SOH_SYS_ID = SOH_SYS_ID
    AND SOH_TXN_CODE IN ('SORLLOC',
    'SORLCT3',
    'SORLNPL',
    'EXPFABLK')
    AND NVL(SOH_CLO_STATUS,0) = 0
    AND NVL(SOI_SHORT_CLO_STATUS,2) = 2
    GROUP BY ITEM_CODE,
    ITEM_NAME,
    LCS_STK_QTY_BU,
    LCS_RCVD_QTY_BU,
    LCS_ISSD_QTY_BU,
    IU_MAX_LOOSE_1,
    ITEM_RORD_LVL_LS,
    ITEM_RORD_LVL,
    ITEM_RORD_QTY_LS,
    ITEM_RORD_QTY,
    LCS_ITEM_CODE
    ORDER BY ITEM_CODE ASC
    2) WORK-ORDERS QUERY :
    SELECT DISTINCT PWH_NO PWO_NO,
    PWH_DT PWO_DT,
    (CASE
    WHEN PWFGPI_QTY = 0 THEN PWH_ITEM_CODE
    ELSE PWFGPI_ITEM_CODE
    END) ITEMCODE,
    ITEM_NAME PRODUCT_NAME,
    (CASE
    WHEN PWFGPI_QTY = 0 THEN SUM(PWH_QTY)
    ELSE PWFGPI_QTY * SUBSTR(PWFGPI_ITEM_CODE,11,3)
    END) PWO_QTY,
    PSD_PR_ACCP_QTY_BU / 1000 PROD_REP,
    PWH_PS_QTY_BU / 1000 PROD_SLIP_PENDING
    FROM OT_PWO_HEAD,
    OM_ITEM,
    OT_PWO_STAGE_DETAIL,
    OT_PWO_FG_PACKED_ITEM
    WHERE PWH_ITEM_CODE = ITEM_CODE
    AND PWFGPI_PWH_SYS_ID = PWH_SYS_ID
    AND NVL(PWH_CLO_STATUS,0) = 0
    AND PSD_PWH_SYS_ID = PWH_SYS_ID
    AND PWH_PS_QTY_BU / 1000 IS NULL
    GROUP BY PWH_NO,
    PWH_DT,
    PWH_ITEM_CODE,
    ITEM_NAME,
    PWFGPI_ITEM_CODE,
    PWFGPI_QTY,
    PSD_PR_ACCP_QTY_BU,
    PWH_PS_QTY_BU,
    ITEM_CODE
    ORDER BY PWH_NO

    That's a big query.
    Can I point out that
                    (CASE
                        WHEN SUM (  TO_NUMBER (soi_qty || '.' || soi_qty_ls)
                                  - (  soi_invi_qty_bu
                                     / iu_conv_factor
                                     / iu_max_loose_1
                                 ) < 0
                           THEN 0
                        ELSE SUM (  TO_NUMBER (soi_qty || '.' || soi_qty_ls)
                                  - (  soi_invi_qty_bu
                                     / iu_conv_factor
                                     / iu_max_loose_1
                     ENDis just
                    GREATEST(0, SUM (  TO_NUMBER (soi_qty || '.' || soi_qty_ls)
                                  - (  soi_invi_qty_bu
                                     / iu_conv_factor
                                     / iu_max_loose_1
                                    )and
                    DECODE (item_rord_qty_ls,
                            NULL, item_rord_qty,
                            (item_rord_qty || '.' || item_rord_qty_ls
                           )is just
    RTRIM (item_rord_qty || '.' || item_rord_qty_ls,'.')

  • Inner Join performance problem.

    Hi,
    I wrote a select statement using inner join on table VBRK , VBUK, VBAP and VBRP.
    This select statement is working fine from last two years, but suddenly to execute this select statement
    taking lot of time and program going to dump.
    But same select statement is working in development and quality systems and not working in production system. Based on given selection we check the tables in production we found only 10 records, but to fetch these 10 records also it will taking lot of time and going to dump.
    can anyone please advise on the same.
    Thanks in advance.

    Hi,
    Please:
    1. Create DB view instead of inner join
    2. Use the primary key of the base table (the first or main table in your view) in your where clause
    3. If not possible, then you need to create secondary index in your base table that match with your where clause fields.
    4. Try to use positive relationship operator, like EQ instead NE, GT, etc.
    Hope it helps.
    Lim...

  • Object performance,need detail of Oracle's internal performance testing

    hi Geoff,
    from your previous answer:
    From an Oracle's comprehensive internal performance testing,
    object implementation of an application consistently matches
    those of relational implementation.
    For some operations, using objects performed better. can you tell more about the result of the testing ?
    we need to get the comparison between the two implementation,
    in order to know in which case should use object implementation
    and in which case should not.
    thanks
    Ray

    Ray,
    Before I name some cases that objects perform better, I still
    want to emphasize that your application object model comes
    first. Here are the cases:
    1. If you have nested objects (e.g., customer with address
    attribute), querying the nested objects would work faster than
    relational access.
    2. If you have containment objects (e.g., customer with VARRAY
    of phone numbers), querying these contained objects would also
    work faster than relational.
    What is your application? What does your object model look like?
    The more specific your question is, the better I can answer it.
    Regards,
    Geoff
    hi Geoff,
    from your previous answer:
    From an Oracle's comprehensive internal performance testing,
    object implementation of an application consistently matches
    those of relational implementation.
    For some operations, using objects performed better. can you tell more about the result of the testing ?
    we need to get the comparison between the two implementation,
    in order to know in which case should use object implementation
    and in which case should not.
    thanks
    Ray

  • Master Details form (LOV based on Detail Column of Join Condition)

    I have created a master detail form where user_id is joining master and details.
    I have created one dynamic lov based on child user_id in detail block to diplay all user who works under current user.
    Problem : When i want to select Insert detail action in detail block the dynamic lov should read the user_id which is going to be inserted when you press Save button. Means as its not getting populated till one click on save button my lov is not getting refereshed.
    Please advice what should i do.
    Thanks
    Bakulesh

    I solved myself by modifing some guru's script from this forum little bit. I am adding here for feedback or use to any.
    htp.p('<script language="JavaScript1.3">
    function getMstFieldValue(form,fieldName)
    var objName = "";
    var tmp = "";
    var dAction = "";
    var sel_idx = 0;
    var cnt = 0;
    var instance = 0;
    var slicedName;
    var fillData = new Array();
    var blkname;
    for(var i = 0; i < form.length; i++)
    slicedName = form.elements.name.split(".");
    tmp = slicedName[2];
    instance = parseInt(slicedName[3],10);
    blkname = slicedName[1];
    //alert("Fld "+tmp+" blk "+blkname+ " instance "+instance);
    if (!tmp)
    continue;
    objName = tmp;
    if (objName == fieldName && blkname == "MASTER_BLOCK")
    return form.elements[i].value;
    function setDetFieldValue(form,fieldName,value)
    var objName = "";
    var tmp = "";
    var dAction = "";
    var sel_idx = 0;
    var cnt = 0;
    var instance = 0;
    var slicedName;
    var fillData = new Array();
    var blkname;
    for(var i = 0; i < form.length; i++)
    slicedName = form.elements[i].name.split(".");
    tmp = slicedName[2];
    instance = parseInt(slicedName[3],10);
    blkname = slicedName[1];
    //alert("Fld "+tmp+" blk "+blkname+ " instance "+instance);
    if (!tmp)
    continue;
    objName = tmp;
    if (objName == fieldName && blkname == "DETAIL_BLOCK")
    form.elements[i].value = value;
    </script>');
    thanks
    Bakulesh

  • Bug in JOIN syntax? (oracle 9i)

    Hi,
    take these three tables:
    MASTER (id NUMBER, name VARCHAR2(10))
    DETAIL (id NUMBER, master_id NUMBER)
    SUBDETAIL (id NUMBER, detail_id NUMBER, name VARCHAR(10)
    When I perform this query:
    SELECT SUBDETAIL.id as did, MASTER.id as mid
    FROM SUBDETAIL
    JOIN DETAIL ON (SUBDETAIL.detail_id = DETAIL.id)
    JOIN MASTER ON (DETAIL.master_id = MASTER.id)
    WHERE
    name = 'joe';
    I would expect the parser to give me 'column ambiguously defined' (because the 'name' field from the whereclause is defined in both subdetail and master).
    However, it does not say that. Instead, it assumes that it should use the name field from master. This is confusing, as this could easily lead to mistakes (as it did in my application)
    Greetings,
    Ivo

    There seems to be a difference between the way Oracle resolves column names using the ANSI join syntax and Oracle's syntax. It appears that Oracle does not know about the columns, until it processes each join, and further, the last table joined seems to be sued to resolve nameing conflicts. Consider:
    SQL> SELECT * FROM master;
            ID NAME
             1 joe
    SQL> SELECT * FROM subdetail;
            ID  DETAIL_ID NAME
             1          2 fred
    SQL> SELECT * FROM detail;
            ID  MASTER_ID
             2          1
    SQL> SELECT subdetail.id AS did, master.id AS mid
      2  FROM subdetail
      3       JOIN detail ON (subdetail.detail_id = detail.id)
      4       JOIN master ON (detail.master_id = master.id)
      5  WHERE name = 'joe';
           DID        MID
             1          1
    SQL> SELECT subdetail.id AS did, master.id AS mid
      2  FROM subdetail
      3       JOIN detail ON (subdetail.detail_id = detail.id)
      4       JOIN master ON (detail.master_id = master.id)
      5  WHERE name = 'fred';
    no rows selected
    So, it is clearly going after master.name. However,
    SQL> SELECT subdetail.id AS did, master.id AS mid
      2  FROM detail
      3       JOIN master ON (master.id = master_id)
      4       JOIN subdetail ON (subdetail.detail_id = detail.id)
      5  WHERE name = 'joe'
    no rows selected
    But,
    SQL> SELECT subdetail.id AS did, master.id AS mid
      2  FROM detail
      3       JOIN subdetail ON (subdetail.detail_id = detail.id)
      4       JOIN master ON (master.id = master_id)
      5  WHERE name = 'joe'
           DID        MID
             1          1
    Old style syntax gives:
    SQL> SELECT subdetail.id AS did, master.id AS mid
      2  FROM subdetail, detail, master
      3  WHERE subdetail.detail_id = detail.id and
      4        detail.master_id = master.id and
      5        name = 'joe';
          name = 'joe'
    ERROR at line 5:
    ORA-00918: column ambiguously defined
    and note that
    SQL> SELECT subdetail.id AS did, master.id AS mid
      2  FROM subdetail
      3      JOIN master ON (detail.master_id = master.id)
      4      JOIN detail ON (subdetail.detail_id = detail.id)
      5  WHERE name = 'joe'
        JOIN master ON (detail.master_id = master.id)
    ERROR at line 3:
    ORA-00904: invalid column nameSo, in ANSI syntax, order matters, and whatever the syntax good testing matters.
    TTFN
    John

  • Simple MDX performing very poor

    Team , This seems to be a very simple Query and not sure why is it taking too much of time for a single day's date range , any pointers would highly be appreciated !
    WITH MEMBER [Measures].[Active Census] AS
    [Measures].[Active Patient Count]
    MEMBER [Measures].[Sum Active Patient Days] AS
    SUM(
    [Patient].[Patient].[Patient].MEMBERS,
    IIF( ([Measures].[Death Count]>0 OR [Measures].[Discharge Count]>0 )
    , [Measures].[Active Patient Days]
    , NULL
    MEMBER [Measures].[Active Medicare Census] AS
    SUM(
    [Patient].[Patient].[Patient].MEMBERS * [Insurance].[Insurance Type].&[Medicare],
    IIF( [Measures].[Active Patient Count] >0 , 1, NULL )
    MEMBER [Measures].[Medicare Admits] AS
    SUM(
    [Patient].[Patient].[Patient].MEMBERS * [Insurance].[Insurance Type].&[Medicare],
    IIF( [Measures].[Admission Count] >0 , 1, NULL )
    MEMBER [Measures].[Medicare Discharges] AS
    SUM(
    [Patient].[Patient].[Patient].MEMBERS * [Insurance].[Insurance Type].&[Medicare],
    IIF( [Measures].[Discharge Count]>0 , 1, NULL )
    MEMBER [Measures].[Medicare Referral Count] AS
    SUM(
    [Patient].[Patient].[Patient].MEMBERS * [Insurance].[Insurance Type].&[Medicare],
    IIF( [Measures].[Referral Count]>0 , 1, NULL )
    MEMBER [Measures].[Medicare Admits to Referral Ratio] AS
    IIF([Measures].[Medicare Referral Count]=0 OR
    ISEMPTY([Measures].[Medicare Referral Count]) , NULL ,[Measures].[Medicare Admits]/[Measures].[Medicare Referral Count])
    MEMBER [Measures].[Medicare Admits Discharge Ratio] AS
    IIF([Measures].[Medicare Discharges]=0 OR
    ISEMPTY([Measures].[Medicare Discharges]) , NULL ,[Measures].[Medicare Admits]/[Measures].[Medicare Discharges])
    SELECT
    [Measures].[Active Census] -- Census
    ,[Measures].[Active Medicare Census] -- Census #M/C
    ,[Measures].[Death Count] -- Deaths
    , [Measures].[Referral Count] -- # Referrals
    ,[Measures].[Admission Count] -- #Admits
    ,[Measures].[Medicare Admits] -- #Medicare Admits
    ,[Measures].[Medicare Discharges] -- Medicare Discharges
    ,[Measures].[Medicare Referral Count] -- #Medicare Referral Count
    ,[Measures].[Medicare Admits Discharge Ratio] --#Medicare Admits to M/C Discharges Ratio
    ,[Measures].[Medicare Admits to Referral Ratio] -- #Medicare Admits to M/C Referral Ratio
    } ON COLUMNS,
    NON EMPTY (
    [Business Unit].[Business Unit].[Business Unit].Members *
    [Patient Branch].[Patient Branch].[Patient Branch]
    ) ON ROWS
    FROM
    SELECT
    ( STRTOSET(@BusinessUnit), STRTOSET(@PatientBranch) ) ON COLUMNS
    FROM [Patient Admissions]
    WHERE
    IIF ( CDate(@StartDate)>TAIL([Time].[Date].members,1).item(0).member_value,
    { null : TAIL([Time].[Date].members,1).item(0) }
    { STRTOMEMBER("[Time].[DIM TIME].&[" + Format( CDate( @StartDate ) , "yyyyMMdd") + "]"):
    STRTOMEMBER("[Time].[DIM TIME].&[" + Format( CDate( @EndDate ) , "yyyyMMdd") + "]") }
    Thank You !
    Rajkumar Yelugu

    Hi Rajkumar,
    As you said, it seems to be a very simple query. The only thing that cause the performance can be the CrossJoin function. There are multiple CrossJoin function on your query. If you cross-join medium-sized or large-sized sets (e.g., sets
    that contain more than 100 items each), you can end up with a result set that contains many thousands of items—enough to seriously impair performance. For the detail information, please see:
    http://sqlmag.com/data-access/cross-join-performance
    Hope this helps.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Oracle Performance tunning genral question

    Hi,
    Below is the list of Areas of Oracle db for which tunning activities are done. You are invited to comment to it weather this is complete list or need some addition or deletion. As I'm learning PT for Oracle now a days, therefore I want to expand my knowledge by sharing what I'm learning and what I need to learn.
    So comment with Open hearts on it. Espically from experts and Gurus.
    Here is the List
    1-Planning for Performance, include Storage consideration( Weather it is SAN, NAS, DAS), Network planning and host OS planning with proper configuration for running Oracle.
    2-Database desining (Not under-Normalized and not Over-Normalized with proper usage of Indexes, views and Stored Procedures)
    3- Instance tunning (Memory structure + B.g Processes)
    4- Session tunning.
    5- Segment Space tunning.
    6- SQL tunning.
    This is what uptill what I've learned. If it needs addition kindly tell me what are these. Please also provide me links(good and precise one) for PT tutorials on web.Also note that I'm discussing this w.r.t Single instance non-rac db.
    Looking for Good sugessions
    Regards,
    Abbasi

    Hello,
    This is the oracle course contents:
    Contents
    Preface
    1 Introduction
    Course Objectives 1-2
    Organization 1-3
    Agenda 1-4
    What Is Not Included 1-6
    Who Tunes? 1-7
    What Does the DBA Tune? 1-8
    How to Tune 1-10
    Tuning Methodology 1-11
    Effective Tuning Goals 1-13
    General Tuning Session 1-15
    Summary 1-17
    2 Basic Tuning Tools
    Objectives 2-2
    Performance Tuning Diagnostics 2-3
    Performance Tuning Tools 2-4
    Tuning Objectives 2-5
    Top Wait Events 2-6
    DB Time 2-7
    CPU and Wait Time Tuning Dimensions 2-8
    Time Model: Overview 2-9
    Time Model Statistics Hierarchy 2-10
    Time Model Example 2-12
    Dynamic Performance Views 2-13
    Dynamic Performance Views: Usage Examples 2-14
    Dynamic Performance Views: Considerations 2-15
    Statistic Levels 2-16
    Statistics and Wait Events 2-18
    System Statistic Classes 2-19
    Displaying Statistics 2-20
    Displaying SGA Statistics 2-22
    Wait Events 2-23
    Using the V$EVENT_NAME View 2-24
    Wait Classes 2-25
    Displaying Wait Event Statistics 2-26
    Oracle Internal & Oracle Academy Use Only
    iv
    Commonly Observed Wait Events 2-28
    Using the V$SESSION_WAIT View 2-29
    Precision of System Statistics 2-31
    Using Features of the Packs 2-32
    Accessing the Database Home Page 2-34
    Enterprise Manager Performance Pages 2-35
    Viewing the Alert Log 2-37
    Using Alert Log Information as an Aid in Tuning 2-38
    User Trace Files 2-40
    Background Processes Trace Files 2-41
    Summary 2-42
    Practice 2 Overview: Using Basic Tools 2-43
    3 Using Automatic Workload Repository
    Objectives 3-2
    Automatic Workload Repository: Overview 3-3
    Automatic Workload Repository Data 3-4
    Workload Repository 3-5
    Database Control and AWR 3-6
    AWR Snapshot Purging Policy 3-7
    AWR Snapshot Settings 3-8
    Manual AWR Snapshots 3-9
    Managing Snapshots with PL/SQL 3-10
    Generating AWR Reports in EM 3-11
    Generating AWR Reports in SQL*Plus 3-12
    Reading the AWR Report 3-13
    Snapshots and Periods Comparisons 3-14
    Compare Periods: Benefits 3-15
    Compare Periods: Results 3-16
    Compare Periods: Report 3-17
    Compare Periods: Load Profile 3-18
    Compare Periods: Top Events 3-19
    Summary 3-20
    Practice 3 Overview: Using AWR-Based Tools 3-21
    4 Defining Problems
    Objectives 4-2
    Defining the Problem 4-3
    Limit the Scope 4-4
    Setting the Priority 4-5
    Top Wait Events 4-6
    Oracle Internal & Oracle Academy Use Only
    v
    Setting the Priority: Example 4-7
    Top SQL Reports 4-8
    Common Tuning Problems 4-9
    Tuning Life Cycle Phases 4-11
    Tuning During the Life Cycle 4-12
    Application Design and Development 4-13
    Testing: Database Configuration 4-14
    Deployment 4-15
    Production 4-16
    Migration, Upgrade, and Environment Changes 4-17
    ADDM Tuning Session 4-18
    Performance Versus Business Requirements 4-19
    Performance Tuning Resources 4-20
    Filing a Performance Service Request 4-21
    RDA Report 4-22
    Monitoring and Tuning Tool: Overview 4-23
    Summary 4-25
    Practice 4 Overview: Identifying the Problem 4-26
    5 Using Metrics and Alerts
    Objectives 5-2
    Metrics, Alerts, and Baselines 5-3
    Limitation of Base Statistics 5-4
    Typical Delta Tools 5-5
    Oracle Database 11g Solution: Metrics 5-6
    Benefits of Metrics 5-7
    Viewing Metric History Information 5-8
    Using EM to View Metric Details 5-9
    Statistic Histograms 5-10
    Histogram Views 5-11
    Server-Generated Alerts 5-12
    Database Control Usage Model 5-13
    Setting Thresholds 5-14
    Creating and Testing an Alert 5-15
    Metric and Alert Views 5-16
    View User-Defined SQL Metrics 5-17
    Create User-Defined SQL Metrics 5-18
    View User-Defined Host Metrics 5-19
    Create User-Defined Host Metrics 5-20
    Summary 5-21
    Practice Overview 5: Working with Metrics 5-22
    Oracle Internal & Oracle Academy Use Only
    vi
    6 Baselines
    Objectives 6-2
    Comparative Performance Analysis with AWR Baselines 6-3
    Automatic Workload Repository Baselines 6-4
    Moving Window Baseline 6-5
    Baselines in Performance Page Settings 6-6
    Baseline Templates 6-7
    AWR Baselines 6-8
    Creating AWR Baselines 6-9
    Single AWR Baseline 6-10
    Creating a Repeating Baseline Template 6-11
    Managing Baselines with PL/SQL 6-12
    Generating a Baseline Template for a Single Time Period 6-13
    Creating a Repeating Baseline Template 6-14
    Baseline Views 6-15
    Performance Monitoring and Baselines 6-17
    Defining Alert Thresholds Using a Static Baseline 6-19
    Using EM to Quickly Configure Adaptive Thresholds 6-20
    Changing Adaptive Threshold Settings 6-22
    Summary 6-23
    Practice 6: Overview Using AWR Baselines 6-24
    7 Using AWR-Based Tools
    Objectives 7-2
    Automatic Maintenance Tasks 7-3
    Maintenance Windows 7-4
    Default Maintenance Plan 7-5
    Automated Maintenance Task Priorities 7-6
    Tuning Automatic Maintenance Tasks 7-7
    ADDM Performance Monitoring 7-8
    ADDM and Database Time 7-9
    DBTime-Graph and ADDM Methodology 7-10
    Top Performance Issues Detected 7-12
    Database Control and ADDM Findings 7-13
    ADDM Analysis Results 7-14
    ADDM Recommendations 7-15
    Database Control and ADDM Task 7-16
    Changing ADDM Attributes 7-17
    Retrieving ADDM Reports by Using SQL 7-18
    Active Session History: Overview 7-19
    Active Session History: Mechanics 7-20
    Oracle Internal & Oracle Academy Use Only
    vii
    ASH Sampling: Example 7-21
    Accessing ASH Data 7-22
    Dump ASH to File 7-23
    Analyzing the ASH Data 7-24
    Generating ASH Reports 7-25
    ASH Report Script 7-26
    ASH Report: General Section 7-27
    ASH Report Structure 7-28
    ASH Report: Activity Over Time 7-29
    Summary 7-30
    Practice 7 Overview: Using AWR-Based Tools 7-31
    8 Monitoring an Application
    Objectives 8-2
    What Is a Service? 8-3
    Service Attributes 8-4
    Service Types 8-5
    Creating Services 8-6
    Managing Services in a Single-Instance Environment 8-7
    Everything Switches to Services 8-8
    Using Services with Client Applications 8-9
    Using Services with the Resource Manager 8-10
    Services and Resource Manager with EM 8-11
    Services and the Resource Manager: Example 8-12
    Using Services with the Scheduler 8-13
    Services and the Scheduler with EM 8-14
    Services and the Scheduler: Example 8-16
    Using Services with Parallel Operations 8-17
    Using Services with Metric Thresholds 8-18
    Changing Service Thresholds by Using EM 8-19
    Services and Metric Thresholds: Example 8-20
    Service Aggregation and Tracing 8-21
    Top Services Performance Page 8-22
    Service Aggregation Configuration 8-23
    Service Aggregation: Example 8-24
    Client Identifier Aggregation and Tracing 8-25
    trcsess Utility 8-26
    Service Performance Views 8-27
    Summary 8-29
    Practice 8 Overview: Using Services 8-30
    Oracle Internal & Oracle Academy Use Only
    viii
    9 Identifying Problem SQL Statements
    Objectives 9-2
    SQL Statement Processing Phases 9-3
    Parse Phase 9-4
    SQL Storage 9-5
    Cursor Usage and Parsing 9-6
    SQL Statement Processing Phases: Bind 9-8
    SQL Statement Processing Phases: Execute and Fetch 9-9
    Processing a DML Statement 9-10
    COMMIT Processing 9-12
    Role of the Oracle Optimizer 9-13
    Identifying Bad SQL 9-15
    TOP SQL Reports 9-16
    What Is an Execution Plan? 9-17
    Methods for Viewing Execution Plans 9-18
    Uses of Execution Plans 9-19
    DBMS_XPLAN Package: Overview 9-20
    EXPLAIN PLAN Command 9-22
    EXPLAIN PLAN Command: Example 9-23
    EXPLAIN PLAN Command: Output 9-24
    Reading an Execution Plan 9-25
    Using the V$SQL_PLAN View 9-26
    V$SQL_PLAN Columns 9-27
    Querying V$SQL_PLAN 9-28
    V$SQL_PLAN_STATISTICS View 9-29
    Querying the AWR 9-30
    SQL*Plus AUTOTRACE 9-32
    Using SQL*Plus AUTOTRACE 9-33
    SQL*Plus AUTOTRACE: Statistics 9-34
    SQL Trace Facility 9-35
    How to Use the SQL Trace Facility 9-37
    Initialization Parameters 9-38
    Enabling SQL Trace 9-40
    Disabling SQL Trace 9-41
    Formatting Your Trace Files 9-42
    TKPROF Command Options 9-43
    Output of the TKPROF Command 9-45
    TKPROF Output with No Index: Example 9-50
    TKPROF Output with Index: Example 9-51
    Generate an Optimizer Trace 9-52
    Oracle Internal & Oracle Academy Use Only
    ix
    Summary 9-53
    Practice Overview 9: Using Execution Plan Utilities 9-54
    10 Influencing the Optimizer
    Objectives 10-2
    Functions of the Query Optimizer 10-3
    Selectivity 10-5
    Cardinality and Cost 10-6
    Changing Optimizer Behavior 10-7
    Using Hints 10-8
    Optimizer Statistics 10-9
    Extended Statistics 10-10
    Controlling the Behavior of the Optimizer with Parameters 10-11
    Enabling Query Optimizer Features 10-13
    Influencing the Optimizer Approach 10-14
    Optimizing SQL Statements 10-15
    Access Paths 10-16
    Choosing an Access Path 10-17
    Full Table Scans 10-18
    Row ID Scans 10-20
    Index Operations 10-21
    B*Tree Index Operations 10-22
    Bitmap Indexes 10-23
    Bitmap Index Access 10-24
    Combining Bitmaps 10-25
    Bitmap Operations 10-26
    Join Operations 10-27
    Join Methods 10-28
    Nested Loop Joins 10-29
    Hash Joins 10-31
    Sort-Merge Joins 10-32
    Join Performance 10-34
    How the Query Optimizer Chooses Execution Plans for Joins 10-35
    Sort Operations 10-37
    Tuning Sort Performance 10-38
    Reducing the Cost 10-39
    Index Maintenance 10-40
    Dropping Indexes 10-42
    Creating Indexes 10-43
    SQL Access Advisor 10-44
    Table Maintenance for Performance 10-45
    Oracle Internal & Oracle Academy Use Only
    x
    Table Reorganization Methods 10-46
    Summary 10-47
    Practice 10 Overview: Influencing the Optimizer 10-48
    11 Using SQL Performance Analyzer
    Objectives 11-2
    Real Application Testing: Overview 11-3
    Real Application Testing: Use Cases 11-4
    SQL Performance Analyzer: Process 11-5
    Capturing the SQL Workload 11-7
    Creating a SQL Performance Analyzer Task 11-8
    SQL Performance Analyzer: Tasks 11-9
    Optimizer Upgrade Simulation 11-10
    SQL Performance Analyzer Task Page 11-11
    Comparison Report 11-12
    Comparison Report SQL Detail 11-13
    Tuning Regressing Statements 11-14
    Preventing Regressions 11-16
    Parameter Change Analysis 11-17
    Guided Workflow Analysis 11-18
    SQL Performance Analyzer: PL/SQL Example 11-19
    SQL Performance Analyzer: Data Dictionary Views 11-21
    Summary 11-22
    Practice 11: Overview 11-23
    12 SQL Performance Management
    Objectives 12-2
    Maintaining SQL Performance 12-3
    Maintaining Optimizer Statistics 12-4
    Automated Maintenance Tasks 12-5
    Statistic Gathering Options 12-6
    Setting Statistic Preferences 12-7
    Restore Statistics 12-9
    Deferred Statistics Publishing: Overview 12-10
    Deferred Statistics Publishing: Example 12-12
    Automatic SQL Tuning: Overview 12-13
    SQL Statement Profiling 12-14
    Plan Tuning Flow and SQL Profile Creation 12-15
    SQL Tuning Loop 12-16
    Using SQL Profiles 12-17
    SQL Tuning Advisor: Overview 12-18
    Oracle Internal & Oracle Academy Use Only
    xi
    Using the SQL Tuning Advisor 12-19
    SQL Tuning Advisor Options 12-20
    SQL Tuning Advisor Recommendations 12-21
    Using the SQL Tuning Advisor: Example 12-22
    Using the SQL Access Advisor 12-23
    View Recommendations 12-25
    View Recommendation Details 12-26
    SQL Plan Management: Overview 12-27
    SQL Plan Baseline: Architecture 12-28
    Loading SQL Plan Baselines 12-30
    Evolving SQL Plan Baselines 12-31
    Important Baseline SQL Plan Attributes 12-32
    SQL Plan Selection 12-34
    Possible SQL Plan Manageability Scenarios 12-36
    SQL Performance Analyzer and SQL Plan Baseline Scenario 12-37
    Loading a SQL Plan Baseline Automatically 12-38
    Purging SQL Management Base Policy 12-39
    Enterprise Manager and SQL Plan Baselines 12-40
    Summary 12-41
    Practice 12: Overview Using SQL Plan Management 12-42
    13 Using Database Replay
    Objectives 13-2
    Using Database Replay 13-3
    The Big Picture 13-4
    System Architecture: Capture 13-5
    System Architecture: Processing the Workload 13-7
    System Architecture: Replay 13-8
    Capture Considerations 13-9
    Replay Considerations: Preparation 13-10
    Replay Considerations 13-11
    Replay Options 13-12
    Replay Analysis 13-13
    Database Replay Workflow in Enterprise Manager 13-15
    Capturing Workload with Enterprise Manager 13-16
    Capture Wizard: Plan Environment 13-17
    Capture Wizard: Options 13-18
    Capture Wizard: Parameters 13-19
    Viewing Capture Progress 13-20
    Viewing Capture Report 13-21
    Export Capture AWR Data 13-22
    Oracle Internal & Oracle Academy Use Only
    xii
    Viewing Workload Capture History 13-23
    Processing Captured Workload 13-24
    Using the Preprocess Captured Workload Wizard 13-25
    Using the Replay Workload Wizard 13-26
    Replay Workload: Prerequisites 13-27
    Replay Workload: Choose Initial Options 13-28
    Replay Workload: Customize Options 13-29
    Replay Workload: Prepare Replay Clients 13-30
    Replay Workload: Client Connections 13-31
    Replay Workload: Replay Started 13-32
    Viewing Workload Replay Progress 13-33
    Viewing Workload Replay Statistics 13-34
    Packages and Procedures 13-36
    Data Dictionary Views: Database Replay 13-37
    Database Replay: PL/SQL Example 13-38
    Calibrating Replay Clients 13-40
    Summary 13-41
    Practice 13: Overview 13-42
    14 Tuning the Shared Pool
    Objectives 14-2
    Shared Pool Architecture 14-3
    Shared Pool Operation 14-4
    The Library Cache 14-5
    Latch and Mutex 14-7
    Latch and Mutex: Views and Statistics 14-9
    Diagnostic Tools for Tuning the Shared Pool 14-11
    AWR/Statspack Indicators 14-13
    Load Profile 14-14
    Instance Efficiencies 14-15
    Top Waits 14-16
    Time Model 14-17
    Library Cache Activity 14-19
    Avoid Hard Parses 14-20
    Are Cursors Being Shared? 14-21
    Sharing Cursors 14-23
    Adaptive Cursor Sharing: Example 14-25
    Adaptive Cursor Sharing Views 14-27
    Interacting with Adaptive Cursor Sharing 14-28
    Avoiding Soft Parses 14-29
    Sizing the Shared Pool 14-30
    Oracle Internal & Oracle Academy Use Only
    xiii
    Shared Pool Advisory 14-31
    Shared Pool Advisor 14-33
    Avoiding Fragmentation 14-34
    Large Memory Requirements 14-35
    Tuning the Shared Pool Reserved Space 14-37
    Keeping Large Objects 14-39
    Data Dictionary Cache 14-41
    Dictionary Cache Misses 14-42
    SQL Query Result Cache: Overview 14-43
    Managing the SQL Query Result Cache 14-44
    Using the RESULT_CACHE Hint 14-46
    Using the DBMS_RESULT_CACHE Package 14-47
    Viewing SQL Result Cache Dictionary Information 14-48
    SQL Query Result Cache: Considerations 14-49
    UGA and Oracle Shared Server 14-50
    Large Pool 14-51
    Tuning the Large Pool 14-52
    Summary 14-53
    Practice Overview 14: Tuning the Shared Pool 14-54
    15 Tuning the Buffer Cache
    Objectives 15-2
    Oracle Database Architecture 15-3
    Buffer Cache: Highlights 15-4
    Database Buffers 15-5
    Buffer Hash Table for Lookups 15-6
    Working Sets 15-7
    Tuning Goals and Techniques 15-9
    Symptoms 15-11
    Cache Buffer Chains Latch Contention 15-12
    Finding Hot Segments 15-13
    Buffer Busy Waits 15-14
    Calculating the Buffer Cache Hit Ratio 15-15
    Buffer Cache Hit Ratio Is Not Everything 15-16
    Interpreting Buffer Cache Hit Ratio 15-17
    Read Waits 15-19
    Free Buffer Waits 15-21
    Solutions 15-22
    Sizing the Buffer Cache 15-23
    Buffer Cache Size Parameters 15-24
    Dynamic Buffer Cache Advisory Parameter 15-25
    Oracle Internal & Oracle Academy Use Only
    xiv
    Buffer Cache Advisory View 15-26
    Using the V$DB_CACHE_ADVICE View 15-27
    Using the Buffer Cache Advisory with EM 15-28
    Caching Tables 15-29
    Multiple Buffer Pools 15-30
    Enabling Multiple Buffer Pools 15-32
    Calculating the Hit Ratio for Multiple Pools 15-33
    Multiple Block Sizes 15-35
    Multiple Database Writers 15-36
    Multiple I/O Slaves 15-37
    Use Multiple Writers or I/O Slaves 15-38
    Private Pool for I/O Intensive Operations 15-39
    Automatically Tuned Multiblock Reads 15-40
    Flushing the Buffer Cache (for Testing Only) 15-41
    Summary 15-42
    Practice 15: Overview Tuning the Buffer Cache 15-43
    16 Tuning PGA and Temporary Space
    Objectives 16-2
    SQL Memory Usage 16-3
    Performance Impact 16-4
    Automatic PGA Memory 16-5
    SQL Memory Manager 16-6
    Configuring Automatic PGA Memory 16-8
    Setting PGA_AGGREGATE_TARGET Initially 16-9
    Monitoring SQL Memory Usage 16-10
    Monitoring SQL Memory Usage: Examples 16-12
    Tuning SQL Memory Usage 16-13
    PGA Target Advice Statistics 16-14
    PGA Target Advice Histograms 16-15
    Automatic PGA and Enterprise Manager 16-16
    Automatic PGA and AWR Reports 16-17
    Temporary Tablespace Management: Overview 16-18
    Temporary Tablespace: Best Practice 16-19
    Configuring Temporary Tablespace 16-20
    Temporary Tablespace Group: Overview 16-22
    Temporary Tablespace Group: Benefits 16-23
    Creating Temporary Tablespace Groups 16-24
    Maintaining Temporary Tablespace Groups 16-25
    View Tablespace Groups 16-26
    Monitoring Temporary Tablespace 16-27
    Oracle Internal & Oracle Academy Use Only
    xv
    Temporary Tablespace Shrink 16-28
    Tablespace Option for Creating Temporary Table 16-29
    Summary 16-30
    Practice Overview 16: Tuning PGA Memory 16-31
    17 Automatic Memory Management
    Objectives 17-2
    Oracle Database Architecture 17-3
    Dynamic SGA 17-4
    Granule 17-5
    Memory Advisories 17-6
    Manually Adding Granules to Components 17-7
    Increasing the Size of an SGA Component 17-8
    Automatic Shared Memory Management: Overview 17-9
    SGA Sizing Parameters: Overview 17-10
    Dynamic SGA Transfer Modes 17-11
    Memory Broker Architecture 17-12
    Manually Resizing Dynamic SGA Parameters 17-13
    Behavior of Auto-Tuned SGA Parameters 17-14
    Behavior of Manually Tuned SGA Parameters 17-15
    Using the V$PARAMETER View 17-16
    Resizing SGA_TARGET 17-17
    Disabling Automatic Shared Memory Management 17-18
    Configuring ASMM 17-19
    SGA Advisor 17-20
    Monitoring ASMM 17-21
    Automatic Memory Management: Overview 17-22
    Oracle Database Memory Parameters 17-24
    Automatic Memory Parameter Dependency 17-25
    Enabling Automatic Memory Management 17-26
    Monitoring Automatic Memory Management 17-27
    DBCA and Automatic Memory Management 17-29
    Summary 17-30
    Practice 17: Overview Using Automatic Memory Tuning 17-31
    Oracle Internal & Oracle Academy Use Only
    xvi
    18 Tuning Segment Space Usage
    Objectives 18-2
    Space Management 18-3
    Extent Management 18-4
    Locally Managed Extents 18-5
    Large Extents: Considerations 18-6
    How Table Data Is Stored 18-8
    Anatomy of a Database Block 18-9
    Minimize Block Visits 18-10
    The DB_BLOCK_SIZE Parameter 18-11
    Small Block Size: Considerations 18-12
    Large Block Size: Considerations 18-13
    Block Allocation 18-14
    Free Lists 18-15
    Block Space Management 18-16
    Block Space Management with Free Lists 18-17
    Automatic Segment Space Management 18-19
    Automatic Segment Space Management at Work 18-20
    Block Space Management with ASSM 18-22
    Creating an Automatic Segment Space Management Segment 18-23
    Migration and Chaining 18-24
    Guidelines for PCTFREE and PCTUSED 18-26
    Detecting Migration and Chaining 18-27
    Selecting Migrated Rows 18-28
    Eliminating Migrated Rows 18-29
    Shrinking Segments: Overview 18-31
    Shrinking Segments: Considerations 18-32
    Shrinking Segments by Using SQL 18-33
    Segment Shrink: Basic Execution 18-34
    Segment Shrink: Execution Considerations 18-35
    Using EM to Shrink Segments 18-36
    Table Compression: Overview 18-37
    Table Compression Concepts 18-38
    Using Table Compression 18-39
    Summary 18-40
    19 Tuning I/O
    Objectives 19-2
    I/O Architecture 19-3
    File System Characteristics 19-4
    I/O Modes 19-5
    Oracle Internal & Oracle Academy Use Only
    xvii
    Direct I/O 19-6
    Bandwidth Versus Size 19-7
    Important I/O Metrics for Oracle Databases 19-8
    I/O Calibration and Enterprise Manager 19-10
    I/O Calibration and the PL/SQL Interface 19-11
    I/O Statistics: Overview 19-13
    I/O Statistics and Enterprise Manager 19-14
    Stripe and Mirror Everything 19-16
    Using RAID 19-17
    RAID Cost Versus Benefits 19-18
    Should I Use RAID 1 or RAID 5? 19-20
    Diagnostics 19-21
    Database I/O Tuning 19-22
    What Is Automatic Storage Management? 19-23
    Tuning ASM 19-24
    How Many Disk Groups per Database 19-25
    Which RAID Configuration for Best Availability? 19-26
    ASM Mirroring Guidelines 19-27
    ASM Striping Granularity 19-28
    What Type of Striping Works Best? 19-29
    ASM Striping Only 19-30
    Hardware RAID Striped LUNs 19-31
    ASM Guidelines 19-32
    ASM Instance Initialization Parameters 19-33
    Dynamic Performance Views 19-34
    Monitoring Long-Running Operations by Using V$ASM_OPERATION 19-36
    ASM Instance Performance Diagnostics 19-37
    ASM Performance Page 19-38
    Database Instance Parameter Changes 19-39
    ASM Scalability 19-40
    Summary 19-41
    20 Performance Tuning Summary
    Objectives 20-2
    Necessary Initialization Parameters with Little Performance Impact 20-3
    Important Initialization Parameters with Performance Impact 20-4
    Sizing Memory Initially 20-6
    Database High Availability: Best Practices 20-7
    Undo Tablespace: Best Practices 20-8
    Temporary Tablespace: Best Practices 20-9
    General Tablespace: Best Practices 20-11
    Internal Fragmentation Considerations 20-12
    Oracle Internal & Oracle Academy Use Only
    xviii
    Block Size: Advantages and Disadvantages 20-13
    Automatic Checkpoint Tuning 20-14
    Sizing the Redo Log Buffer 20-15
    Sizing Redo Log Files 20-16
    Increasing the Performance of Archiving 20-17
    Automatic Statistics Gathering 20-19
    Automatic Statistics Collection: Considerations 20-20
    Commonly Observed Wait Events 20-21
    Additional Statistics 20-22
    Top 10 Mistakes Found in Customer Systems 20-23
    Summary 20-25
    Appendix A: Practices and Solutions
    Appendix B: Using Statspack
    Index

Maybe you are looking for