Query optimizaing for performance tune

Hi guys,
              The below  query is taking a lot of time to execute.The main problem is with table S022.This table is going for full table scan everytime  even if we give a lot of selection criteria.So is there any alternate table for S022.In selection screen the mandatory fields are Location,plant and Phase.
SELECT a~aufnr      "Order number
         e~arbpl      "Work center
         e~plnum      "Plaaned order
         b~objnr      "Object number
         a~werks      "plant
         c~charg      "Batch
         d~gamng      "qty
         d~gmein      "UOM
         d~plnbez     "Material
         d~aufpl      "routing no
         d~aprio      "Order priority
         d~fevor      "Responsible planner group/department
         f~aufpl      "Routing no
         f~aplzl      "general counter
         f~vornr      "Phase
         f~arbid      "workcenter
         f~ltxa1      "text
         g~objty      "Object type
         g~stand      " Location
         INTO CORRESPONDING FIELDS OF TABLE t_afpo
          FROM (  (  ( (  ( s022 AS e
                      INNER JOIN aufk AS a ON   aaufnr = eaufnr )
                      INNER JOIN jest AS b ON   aobjnr = bobjnr )
                      INNER JOIN afpo AS c ON   caufnr = aaufnr
                                           AND  awerks = cdwerk )
                      INNER JOIN afko AS d ON   daufnr = caufnr
                      INNER JOIN afvc AS f ON   faufpl   = daufpl
                                           AND  fvornr   = evornr )
                     INNER JOIN crhd AS g ON    garbpl = earbpl
                                               AND gobjid = farbid )
            WHERE    a~werks  IN s_werks
            AND      d~plnbez IN s_matnr
            AND      d~fevor  IN s_fevor
            AND      e~arbpl  IN s_arbpl
            AND      e~aufnr  IN s_aufnr
            AND      a~auart  IN r_auart
            AND      e~ssavd  IN s_date
            AND      e~vornr  IN s_vornr
            AND      g~stand   IN s_stand
            AND      a~loekz  NE 'X'
            AND      b~stat = c_i0002
            AND      b~inact = space.

Hi,
i would suggest that dont put too many joins in the select statement..
if possible try to put mulitple select statements using "for all entries".
and also join the table only with key fields so that the data fetching will be more faster..
if you are not able to use the key fields try with index fields provided by SAP..
if that is also not working then create Zindex field for the table which is using more time to fetch the data.
Regards
JK

Similar Messages

  • Need help for performance tunning

    Hello,
    I have 16K records return by query, it takes long time to proceed for 7K it takes 7.5 sec.
    Note: I used all seeded tables only.
    If possible please help me to tune it.
    SELECT       msi.inventory_item_id,msi.segment1,msi.rimary_uom_code , msi.primary_unit_of_measure
    FROM  mtl_system_items_b msi, qp_list_lines qpll,qp_pricing_attributes qppr,
              mtl_category_sets_tl mcs,mtl_category_sets_b mcsb,
              mtl_categories_b mc, mtl_item_categories mcb
    WHERE     msi.enabled_flag = 'Y'
         AND qpll.list_line_id = qppr.list_line_id
         AND qppr.product_attr_value = TO_CHAR (msi.inventory_item_id(+))
         AND qppr.product_uom_code = msi.primary_uom_code
         AND mc.category_id = mcb.category_id
         AND msi.inventory_item_id = mcb.inventory_item_id
         AND msi.organization_id = mcb.organization_id
         AND TRUNC (SYSDATE) BETWEEN NVL (qpll.start_date_active,TRUNC (SYSDATE)) AND NVL (qpll.end_date_active,TRUNC (SYSDATE))
         AND mcs.category_set_name = 'LSS SALES CATEGORY'
         AND mcs.language = 'US'
         AND mcs.category_set_id = mcsb.category_set_id
         AND mcsb.structure_id = mc.structure_id
         AND msi.organization_id = :p_organization_id
         AND qpll.list_header_id = :p_price_list_id
         AND mcb.category_id = :p_category_id;
    Thanks and regards
    Akil.

    Thanks Helios ,
    here is answers
    Databse version
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit  
    PL/SQL Release 11.1.0.7.0
    explain plan
    | Id  | Operation                       | Name                     | Rows  | Bytes | Cost (%CPU)|

    0 | SELECT STATEMENT              
    |                          |   
    1 |   149 |  9439 
    (1)|

    1 |  NESTED LOOPS                   |                          |     1 | 
    149 |  9439   (1)|
    |*
    2 |   HASH JOIN OUTER               |                          |     1 | 
    135 |  9437   (1)|
    |*
    3 |    HASH JOIN                    |                          |     1 |  
    71 |  9432   (1)|

    4 |     NESTED LOOPS                |                          |     2 |  
    76 |    53   (0)|
    |*
    5 |      TABLE ACCESS BY INDEX
    ROWID| QP_LIST_LINES            |     2 |  
    44 |    49   (0)|
    |*
    6 |       INDEX SKIP SCAN           | QP_LIST_LINES_N2         | 
    702 |       |    20 
    (0)|
    |*
    7 |      INDEX RANGE SCAN           | QP_PRICING_ATTRIBUTES_N3 |     1 |  
    16 |     2   (0)|
    |*
    8 |     TABLE ACCESS BY INDEX
    ROWID | MTL_SYSTEM_ITEMS_B       | 46254
    |  1490K|
    9378   (1)|
    |*
    9 |      INDEX RANGE SCAN           | MTL_SYSTEM_ITEMS_B_N9    | 46254 |       | 
    174   (1)|
    |
    10 |    TABLE ACCESS FULL            | XX_WEB_ITEM_IMAGE_TBL    | 
    277 | 17728 |     5   (0)|
    |* 11 |   INDEX RANGE SCAN              | MTL_ITEM_CATEGORIES_U1   |   
    1 |    14 |     2 
    (0)|
    Predicate Information (identified
    by operation id):
    2 -
    access("XWIIT"."IMAGE_CODE"(+)="MSI"."SEGMENT1")
    3 -
    access("QPPR"."PRODUCT_ATTR_VALUE"=TO_CHAR("MSI"."INVENTORY_ITEM_ID")
    AND
    "QPPR"."PRODUCT_UOM_CODE"="MSI"."PRIMARY_UOM_CODE")
    5 - filter(NVL("QPLL"."START_DATE_ACTIVE",TRUNC(SYSDATE@!))<=TRUNC(SYSDATE@!)
    AND
    NVL("QPLL"."END_DATE_ACTIVE",TRUNC(SYSDATE@!))>=TRUNC(SYSDATE@!))
    6 -
    access("QPLL"."LIST_HEADER_ID"=TO_NUMBER(:P_PRICE_LIST_ID))
    filter("QPLL"."LIST_HEADER_ID"=TO_NUMBER(:P_PRICE_LIST_ID))
    7 -
    access("QPLL"."LIST_LINE_ID"="QPPR"."LIST_LINE_ID")
    filter("QPPR"."PRODUCT_UOM_CODE" IS NOT NULL)
    8 - filter("MSI"."ENABLED_FLAG"='Y')
    9 - access("MSI"."ORGANIZATION_ID"=TO_NUMBER(:P_ORGANIZATION_ID))
    11 -
    access("MCB"."ORGANIZATION_ID"=TO_NUMBER(:P_ORGANIZATION_ID)
    AND
    "MSI"."INVENTORY_ITEM_ID"="MCB"."INVENTORY_ITEM_ID"
    AND
    "MCB"."CATEGORY_ID"=TO_NUMBER(:P_CATEGORY_ID))
           filter("MCB"."CATEGORY_ID"=TO_NUMBER(:P_CATEGORY_ID))
    Note
    - 'PLAN_TABLE' is old version
    TKprof Plan
    TKPROF: Release 11.1.0.7.0 - Production on Fri Nov 15 06:12:26 2013
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    Trace file: LSSD_ora_19760.trc
    Sort options: default
    count    = number of times OCI procedure was executed
    cpu      = cpu time in seconds executing
    elapsed  = elapsed time in seconds executing
    disk     = number of physical reads of buffers from disk
    query    = number of buffers gotten for consistent read
    current  = number of buffers gotten in current mode (usually for update)
    rows     = number of rows processed by the fetch or execute call
    SELECT msi.inventory_item_id,
           msi.segment1,
           primary_uom_code,
           primary_unit_of_measure,
           xwiit.image_url
      FROM mtl_system_items_b msi,
           qp_list_lines qpll,
           qp_pricing_attributes qppr,
           mtl_item_categories mcb,
           xx_web_item_image_tbl xwiit
    WHERE     msi.enabled_flag = 'Y'
           AND qpll.list_line_id = qppr.list_line_id
           AND qppr.product_attr_value = TO_CHAR (msi.inventory_item_id)
           AND qppr.product_uom_code = msi.primary_uom_code
           AND msi.inventory_item_id = mcb.inventory_item_id
           AND msi.organization_id = mcb.organization_id
           AND TRUNC (SYSDATE) BETWEEN NVL (qpll.start_date_active,
                                            TRUNC (SYSDATE))
                                   AND NVL (qpll.end_date_active,
                                            TRUNC (SYSDATE))
           AND xwiit.image_code(+) = msi.segment1
           AND msi.organization_id = :p_organization_id
           AND qpll.list_header_id = :p_price_list_id
           AND mcb.category_id = :p_category_id
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        2      0.00       0.00          0          0          0           0
    Execute      2      0.00       0.00          0          0          0           0
    Fetch        2      3.84       3.85          0     432560          0        1002
    total        6      3.84       3.85          0     432560          0        1002
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 173 
    Rows     Row Source Operation
        501  NESTED LOOPS  (cr=216280 pr=0 pw=0 time=115 us cost=9439 size=149 card=1)
       2616   HASH JOIN OUTER (cr=211012 pr=0 pw=0 time=39 us cost=9437 size=135 card=1)
      78568    HASH JOIN  (cr=210997 pr=0 pw=0 time=3786 us cost=9432 size=71 card=1)
      78571     NESTED LOOPS  (cr=29229 pr=0 pw=0 time=35533 us cost=53 size=76 card=2)
      78571      TABLE ACCESS BY INDEX ROWID QP_LIST_LINES (cr=9943 pr=0 pw=0 time=27533 us cost=49 size=44 card=2)
    226733       INDEX SKIP SCAN QP_LIST_LINES_N2 (cr=865 pr=0 pw=0 time=4122 us cost=20 size=0 card=702)(object id 99730)
      78571      INDEX RANGE SCAN QP_PRICING_ATTRIBUTES_N3 (cr=19286 pr=0 pw=0 time=0 us cost=2 size=16 card=1)(object id 99733)
    128857     TABLE ACCESS BY INDEX ROWID MTL_SYSTEM_ITEMS_B (cr=181768 pr=0 pw=0 time=9580 us cost=9378 size=1526382 card=46254)
    128857      INDEX RANGE SCAN MTL_SYSTEM_ITEMS_B_N9 (cr=450 pr=0 pw=0 time=1657 us cost=174 size=0 card=46254)(object id 199728)
        277    TABLE ACCESS FULL XX_WEB_ITEM_IMAGE_TBL (cr=15 pr=0 pw=0 time=22 us cost=5 size=17728 card=277)
        501   INDEX RANGE SCAN MTL_ITEM_CATEGORIES_U1 (cr=5268 pr=0 pw=0 time=0 us cost=2 size=14 card=1)(object id 99557)
    Note: I modified query and it gives good result, now it takes 3 to 4 sec for 16000 records.
    If possible can you plz explain what we have to take care while doing performance tunning
    I am a fresher so don't have that much idea.
    and also Thanks Hussein for your replay

  • Query for performance tunning

    Hi,
    Millions of records are there in this order table and it takes hours to run the below query
    update orders
    set s_last_name = decode(s_last_name, null, null, (select last_name from cust where cust_id = orders.cust_id)),
    credit_card = null;
    Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    UPDATE STATEMENT | | 35M| 1388M| 319K (3)| 01:03:55 |
    UPDATE | ORDERS | | | | |
    PARTITION RANGE ALL | | 35M| 1388M| 319K (3)| 01:03:55 |
    TABLE ACCESS FULL | ORDERS | 35M| 1388M| 319K (3)| 01:03:55 |
    TABLE ACCESS BY GLOBAL INDEX ROWID | CUST | 1 | 14 | 3 (0) | 00:00:01 |
    INDEX RANGE SCAN | CUST_PK| 1 | | 2 (0) | 00:00:01 |
    is it possible to write in a different way to improve the performance.. thanks. Bcj

    You're running an update with an uncorrelated subquery. These can be horrifically slow. You generally have 2 options:
    1. Correlated subquery
    2. Do the update inside a loop. #1 if possible will probably be faster
    1. Correlated subquery looks something like
    update table A
        setl (column1, column2) = (select column1, column2
                                                  from table2
                                                where table2.key = A.key
                                         )which might be faster, if the lookup table is properly indexed on the correlated column
    2. Update in loop looks something like
      for record in (key, select column1, column2 from table)loop
        update table2
            set column1 = record.column1, column2 = record.column2
          where table2.key = record.key
      end loop;which may be faster than the original update (or may not). This method has the advantage of allowing periodic commits; people who say you should never do periodic commits have never blown out rollback segments. If you must use the loop method commit at least 4k rows (more rows per commit is better).

  • Help for performance tunning

    Hi Gurus,
    I m new to the group and SAP BW as well,so i need ur valuable inputs for a Performance related Project.
    I m going to start  a new project in a wks time so and i m working as a Performance Tuning Consultant on that(Load & Query Performance),but i don't have any idea about this,so i need ur valuable advice on that,plz.
    Can anyone plz suggest me the possible ways of suggestions so that i can tell the client as a gud consultant to start with but these days i m going though BW Performance & Authorization(BW360) which is really helpful for me but apart from that i need ur valuable inputs as well.
    Thanks in Advance.
    regards
    Amit

    hi Amit,
    check this.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/afbad390-0201-0010-daa4-9ef0168d41b6
    also
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/media/uuid/10b589ad-0701-0010-0299-e5c282b7aaad
    regards.

  • Query Tuning for Performance

    Dear Experts,
    Please find herewith below my code. The problem is with KONV table... This report is based on many conditions of KONV table... So the specific table has to be READ many times with all data. How can i Fine tune it... The report is taking a long time to execute... Any commands or way to optimise the report..
    SELECT
            vbeln_i
            vkorg
            vtweg
            spart
            fkart
            land1
            fkdat
            kunrg
            knumv
            waerk
            kurrf
            vkbur_i
            vkgrp_i
            matnr_i
            vrkme_i
            fkimg_i
            matkl_i
            posnr_i
            netwr_i
            augru_auft_i
            aubel_i
            vgbel_i
            pstyv_i
            vstel_i
            prctr_i
            FROM wb2_v_vbrk_vbrp2 INTO corresponding fields of TABLE it_vbrk
            WHERE
            vkorg = p_vkorg AND
            vtweg = '30' AND
            spart IN so_spart AND
            kunrg IN so_kunrg AND
            fkart IN so_fkart AND
            vbeln_i IN so_vbeln AND
            fkdat IN so_fkdat AND
            vkbur_i IN so_vkbur AND
            vkgrp_i IN so_vkgrp AND
            matnr_i IN so_matnr AND
            fkimg_i <> '0'.
    sort it_vbrk by vbeln_i knumv posnr_i.
      IF it_vbrk[] IS NOT INITIAL.
        SELECT
              knumv
              kposn
              stunr
              kschl
              krech
              kbetr
              kpein
              waers
              kmein
              kkurs
              kinak
              FROM konv INTO TABLE it_konv
              FOR ALL ENTRIES IN it_vbrk
              WHERE knumv = it_vbrk-knumv AND
              kschl IN ('ZPR0','Z305','ZCCM','ZFCM').
    sort it_konv by knumv.
        SELECT
              belnr
              hkont
              prctr
              dmbtr
              matnr
              werks
              FROM bseg INTO TABLE it_fin
              FOR ALL ENTRIES IN it_vbrk
              WHERE belnr = it_vbrk-vbeln_i AND
              matnr = it_vbrk-matnr_i AND
              werks = it_vbrk-vstel_i AND
              prctr = it_vbrk-prctr_i.
    sort it_fin by belnr.
        LOOP AT it_vbrk INTO wa_vbrk.
          wa_data-vbeln = wa_vbrk-vbeln_i.
          wa_data-vkbur = wa_vbrk-vkbur_i.
          wa_data-vkgrp = wa_vbrk-vkgrp_i.
          wa_data-matnr = wa_vbrk-matnr_i.
          wa_data-vrkme = wa_vbrk-vrkme_i.
          wa_data-matkl = wa_vbrk-matkl_i.
          wa_data-posnr = wa_vbrk-posnr_i.
          wa_data-netwr = wa_vbrk-netwr_i.
          wa_data-reas = wa_vbrk-reas_i.
          wa_data-aubel = wa_vbrk-aubel_i.
          wa_data-vgbel = wa_vbrk-vgbel_i.
          wa_data-pstyv = wa_vbrk-pstyv_i.
          wa_data-vkorg = wa_vbrk-vkorg.
          wa_data-vtweg = wa_vbrk-vtweg.
          wa_data-spart = wa_vbrk-spart.
          wa_data-fkart = wa_vbrk-fkart.
          wa_data-land1 = wa_vbrk-land1.
          wa_data-fkdat = wa_vbrk-fkdat.
          wa_data-kunrg = wa_vbrk-kunrg.
          wa_data-knumv = wa_vbrk-knumv.
          wa_data-waerk = wa_vbrk-waerk.
          wa_data-kurrf = wa_vbrk-kurrf.
          wa_data-prctr = wa_vbrk-prctr_i.
          wa_data-vstel = wa_vbrk-vstel_i.
    *    move-corresponding wa_vbrk to wa_data.
          READ TABLE it_fin WITH KEY belnr = wa_data-vbeln matnr = wa_data-matnr.
          if it_fin-belnr = wa_data-vbeln.
          wa_data-hkont = it_fin-hkont.
          SELECT SINGLE txt20 INTO wa_data-gltxt FROM skat WHERE spras = 'EN' AND saknr = wa_data-hkont AND ktopl = '1000'.
          endif.
          SELECT SINGLE maktx FROM makt INTO wa_data-maktx WHERE matnr = wa_data-matnr.
          SELECT SINGLE zeinr matkl FROM mara INTO (wa_data-zeinr,wa_data-matkl) WHERE matnr = wa_data-matnr.
          SELECT SINGLE bezei FROM tvkbt INTO wa_data-soff WHERE vkbur = wa_data-vkbur AND spras = 'E'.
          SELECT SINGLE bezei FROM tvgrt INTO wa_data-sgrp WHERE vkgrp = wa_data-vkgrp AND spras = 'E'.
          SELECT SINGLE vtext INTO wa_data-division FROM tspat WHERE spart = wa_data-spart AND spras = 'EN'.
    * added on 23.06.2008
          READ TABLE it_konv INTO wa_konv WITH KEY knumv = wa_data-knumv kposn = wa_data-posnr kschl = 'ZPR0' kinak = ''.
          wa_data-kschl = wa_konv-kschl.
          wa_data-kposn = wa_konv-kposn.
          wa_data-stunr = wa_konv-stunr.
          wa_data-kbetr = wa_konv-kbetr.
          wa_data-kpein = wa_konv-kpein.
          wa_data-kkurs = wa_konv-kkurs.
    * This is calculating per unit rate
          wa_data-rate = ( wa_data-kbetr * wa_data-kpein ) / wa_data-kpein .
          wa_data-drate = wa_data-rate.
          CLEAR wa_konv.
          READ TABLE it_konv INTO wa_konv WITH KEY knumv = wa_data-knumv kposn = wa_data-posnr kschl = 'Z305' krech = 'A'.
          IF wa_konv-kbetr <> 0.
            wa_data-kbetr1 = ABS( wa_konv-kbetr ).
            wa_data-drate =  wa_data-rate  - ( wa_data-rate * ( ( wa_data-kbetr1 / 10 ) / 100 ) ).
            wa_data-dperc = ( wa_data-kbetr1 / 10 ).
            IF  wa_data-fkart = 'S1' OR wa_data-fkart = 'RE' OR wa_data-fkart = 'ZRES' OR wa_data-fkart = 'Z2RE' OR wa_data-fkart = 'G2' .
              IF wa_data-pstyv = 'TANN' OR wa_data-pstyv = 'ZMOH' OR wa_data-pstyv = 'ZPHY' OR wa_data-pstyv = 'ZSAM' OR wa_data-pstyv = 'ZZNN' OR wa_data-pstyv = 'ZREN1'.
    *    IF WA_DATA-PSTYV = 'TANN' OR WA_DATA-PSTYV = 'ZMOH' OR WA_DATA-PSTYV = 'ZPHY' OR WA_DATA-PSTYV = 'ZSAM' or wa_data-pstyv = 'ZZNN'.
                wa_data-total = '0'.
                wa_data-fkimg = wa_vbrk-fkimg_i * -1.
              ELSE.
                wa_data-fkimg = wa_vbrk-fkimg_i * -1.
                wa_data-total = ( ( wa_data-fkimg * wa_data-drate ) ) / wa_data-kpein.
                wa_data-inrvalue = wa_data-total * wa_data-kurrf.
              ENDIF.
            ELSE.
              IF wa_data-pstyv = 'TANN' OR wa_data-pstyv = 'ZMOH' OR wa_data-pstyv = 'ZPHY' OR wa_data-pstyv = 'ZSAM' OR wa_data-pstyv = 'ZZNN'.
                wa_data-fkimg = wa_vbrk-fkimg_i.
                wa_data-total = '0'.
                wa_data-inrvalue = wa_data-total * wa_data-kurrf.
              ELSE.
                wa_data-fkimg = wa_vbrk-fkimg_i.
                wa_data-total =   ( wa_data-fkimg * wa_data-drate )  / wa_data-kpein.
                wa_data-inrvalue = wa_data-total * wa_data-kurrf.
              ENDIF.
            ENDIF.
          ELSE.
            READ TABLE it_konv INTO wa_konv WITH KEY knumv = wa_data-knumv kposn = wa_data-posnr kschl = 'Z305' krech = 'B'.
            IF wa_konv-kbetr <> 0.
               wa_data-kbetr1 = ABS( wa_konv-kbetr ).
              wa_data-drate = wa_data-rate.
              wa_data-dvalue = wa_data-kbetr1.
              IF  wa_data-fkart = 'S1' OR wa_data-fkart = 'RE' OR wa_data-fkart = 'ZRES' OR wa_data-fkart = 'Z2RE' OR wa_data-fkart = 'G2' .
                IF wa_data-pstyv = 'TANN' OR wa_data-pstyv = 'ZMOH' OR wa_data-pstyv = 'ZPHY' OR wa_data-pstyv = 'ZSAM' OR wa_data-pstyv = 'ZZNN' OR wa_data-pstyv = 'ZREN1'.
    *    IF WA_DATA-PSTYV = 'TANN' OR WA_DATA-PSTYV = 'ZMOH' OR WA_DATA-PSTYV = 'ZPHY' OR WA_DATA-PSTYV = 'ZSAM' or wa_data-pstyv = 'ZZNN'.
                  wa_data-total = '0'.
                  wa_data-fkimg = wa_vbrk-fkimg_i * -1.
                ELSE.
                  wa_data-fkimg = wa_vbrk-fkimg_i * -1.
                  wa_data-total = ( ( wa_data-fkimg * wa_data-rate ) - wa_data-kbetr1 ) * -1.
                  wa_data-inrvalue = wa_data-total * wa_data-kurrf.
                ENDIF.
              ELSE.
                IF wa_data-pstyv = 'TANN' OR wa_data-pstyv = 'ZMOH' OR wa_data-pstyv = 'ZPHY' OR wa_data-pstyv = 'ZSAM' OR wa_data-pstyv = 'ZZNN'.
                  wa_data-fkimg = wa_vbrk-fkimg_i.
                  wa_data-total = '0'.
                  wa_data-inrvalue = wa_data-total * wa_data-kurrf.
                ELSE.
                  wa_data-fkimg = wa_vbrk-fkimg_i.
                  wa_data-total = ( ( wa_data-fkimg * wa_data-rate ) - wa_data-kbetr1 ).
                  wa_data-inrvalue = wa_data-total * wa_data-kurrf.
                ENDIF.
              ENDIF.
            ENDIF.
          ENDIF.
          CLEAR wa_konv.
          IF wa_data-kbetr1 EQ '0'.
            IF  wa_data-fkart = 'S1' OR wa_data-fkart = 'RE' OR wa_data-fkart = 'ZRES' OR wa_data-fkart = 'Z2RE' OR wa_data-fkart = 'G2' .
              IF wa_data-pstyv = 'TANN' OR wa_data-pstyv = 'ZMOH' OR wa_data-pstyv = 'ZPHY' OR wa_data-pstyv = 'ZSAM' OR wa_data-pstyv = 'ZZNN' OR wa_data-pstyv = 'ZREN1'.
    *    IF WA_DATA-PSTYV = 'TANN' OR WA_DATA-PSTYV = 'ZMOH' OR WA_DATA-PSTYV = 'ZPHY' OR WA_DATA-PSTYV = 'ZSAM' or wa_data-pstyv = 'ZZNN'.
                wa_data-total = '0'.
                wa_data-fkimg = wa_vbrk-fkimg_i * -1.
              ELSE.
                wa_data-fkimg = wa_vbrk-fkimg_i * -1.
                wa_data-total = ( ( wa_data-fkimg * wa_data-drate ) ) / wa_data-kpein.
                wa_data-inrvalue = wa_data-total * wa_data-kurrf.
              ENDIF.
            ELSE.
              IF wa_data-pstyv = 'TANN' OR wa_data-pstyv = 'ZMOH' OR wa_data-pstyv = 'ZPHY' OR wa_data-pstyv = 'ZSAM' OR wa_data-pstyv = 'ZZNN'.
                wa_data-fkimg = wa_vbrk-fkimg_i.
                wa_data-total = '0'.
                wa_data-inrvalue = wa_data-total * wa_data-kurrf.
              ELSE.
                wa_data-fkimg = wa_vbrk-fkimg_i.
                wa_data-total =   ( wa_data-fkimg * wa_data-drate )  / wa_data-kpein.
                wa_data-inrvalue = wa_data-total * wa_data-kurrf.
              ENDIF.
            ENDIF.
          ENDIF.
          SELECT SINGLE name1 land1 FROM kna1 INTO (wa_data-name1,wa_data-land1) WHERE kunnr = wa_data-kunrg.
          SELECT SINGLE landx FROM t005t INTO wa_data-landx WHERE land1 = wa_data-land1 AND spras = 'EN'.
          SELECT SINGLE wgbez FROM t023t INTO wa_data-wgbez WHERE matkl = wa_data-matkl.
          SELECT SINGLE bezei FROM tvm1t INTO wa_data-bezei WHERE mvgr1 = wa_data-mvgr3.
          SELECT SINGLE bezei FROM tvm1t INTO wa_data-bezei1 WHERE mvgr1 = wa_data-mvgr4.
          APPEND wa_data TO it_data.
    Please reply...
    Thanks,
    Regards,
    Jitesh

    Hi,
    Dont put select quaries in loop. Its affect performance.First collect all the data in temporary tables.
    then read these tables according to the data collected in final table.
    Also use ranges for select quary of konv.
    also use sort table & make indexing like this.
    for example:
      w_index = sy-index + 1.
      READ TABLE it_vbrk INTO wa_vbrk INDEX w_index.
      IF sy-subrc EQ 0.
        w_tabix = sy-tabix + w_tabix.
        LOOP AT it_vbrk INTO wa_vbrk FROM w_tabix.
       endloop.
    endif.
    or u can use hashed table with unique keys.
    Also check in se30 whether the coding takes time or database fetching takes time.
    Regards,
    Anagha Deshmukh

  • Oracle Analyzer or Some thing else ?(for performance & tunning)

    Hi
    Any body have idea about the tool Oracle Analyzer for performanace & tuning,i heard about this but i couldn't find any sort of documentation on this tool any where.Did this change
    from Oracle Analyzer to Some thing else?.
    Please help in this regard
    Thanks
    Sreeni

    dear sreenivasa kanneganti,
    this is the script to analyze the table and compute statistics
    cheers
    ANALYZE TABLE USER_NAME.TABLE_NAME COMPUTE STATISTICS
    from what I know statistics are used by the Oracle Optimizer
    (if it is set in CHOOSE mode, it is written in the init.ora)
    which stores these statistics in a dictionary of data
    If you want to check the integrity of data you have to use the clause VALIDATE_STRUCTURE
    Of course you have to have the grant to ANALIZE_ANY
    Remember to run the ANALYZE and COMPUTE STATISTICS at the end of
    the day, this because it takes a long time to run... ;-)
    If you want to ANALIZE a complete schema you should use the
    procedure DBMS_UTILITY.ANALIZE_SCHEMA
    cheers
    rjh

  • Is there any link for   Performance  Tunning  Learning  .

    sinha

    Please   go through this  link  .
    it has   like a  book
    step  by step
    <a href="http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_Introduction.asp">http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_Introduction.asp</a>
    Reward  points if it is  usefull,...
    Girish

  • Query Performance Tunning

    Dear Experts,
    I am executing a query which is build on a Multiprovider. The execution time is approx. 12 mins, again if I enable a dimension to analyze it takes another 15 mins.
    The technical details of the query are:
    1) The multiprovider fetches data from three different Cubes.
    2) It contains three diff characteristics out of which one is having a 10 level hierarchy and one is having a 2 level hierarchy. Both the hierarchies are externally maintained.
    3) It contains KPIs which calculate the sales on diff time lines such as CM MTD,  LM MTD, CY YTD, LY YTD with the help of a customer exit.
    4) It converts the quatities in alt unit of measures through an exit.
    Kindly suggest for performance tunning. How shall i achieve min query execution time??
    -Kushal

    HI Kushal,
    effective query on MP can be found
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b03b7f4c-c270-2910-a8b8-91e0f6d77096
    for nw2004s
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a9ab011a-0e01-0010-02a1-d496b94c9c0f
    modeling on multiprovider
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2f5aa43f-0c01-0010-a990-9641d3d4eef7
    docs on performance available in
    FAQ - The Future of SAP NetWeaver Business Intelligence in the Light of the NetWeaver BI&Business Objects Roadmap
    https://service.sap.com/bi
    -> performance
    Also,
    check the parallel processing setting, your query is non cumulative ...
    629541 Multiprovider: Parallel Processing
    911939 Optimization hint for logical MultiProvider partitioning
    907881 MultiProvider with (too) many part providers
    Performance of non-cumulative queries in MultiProviders
    903559 MultiProvider optimization is only partially active
    942554 Perf when working with BI inp help with multiprov on Oracle
    607164 MultiProvider: Sequential processing is faster than parallel
    913975 Performance problems for MultiProviders with many partprov.
    hope this helps
    Best Regards,
    VVenkat..

  • Abap Logic for performance tuning not working when using Internal tables

    Hi,
    I wrote this piece of code that is working correctly that is select SUM of cost from DSO where Plant is the same for Sales Items.
    LOOP AT RESULT_PACKAGE INTO rp.
    SELECT SUM( /N/S_STRDCOST ) FROM /N/ADSP_DPIT00 INTO
    rp-/N/S_STRDCOST
    WHERE /N42/S_SALESITEM = rp-/N42/S_ITEMID AND /N42/S_PLPLANT EQ
    rp-/N42/S_SOURCE.
    MODIFY RESULT_PACKAGE FROM rp.
    Clear rp.
    ENDLOOP.
    Now I try to rewrite it for performance tunning using internal table  but I am getting 0 values. can't figure out whats the problem and been struggling fixing it.
    TYPES : begin of ty_DSO_TABLE,
             /N42/S_STRDCOST TYPE /N/ADSP_DSPC00-/N/S_STRDCOST,
             /N42/S_ITEMID TYPE /N/ADSP_DSPC00-/N/S_ITEMID,
           end of ty_DSO_TABLE.
    DATA: it_DSO_TABLE type hashed table of ty_DSO_TABLE with unique key
    /N/S_ITEMID,
         wa_DSO_TABLE type ty_DSO_TABLE.
    Field-symbols:  <rp> TYPE tys_TG_1.
    LOOP AT RESULT_PACKAGE assigning <rp>.
      clear wa_DSO_TABLE.
    Read table IT_DSO_TABLE into wa_DSO_TABLE with table key /N/S_ITEMID
      = <rp>-/N/S_ITEMID.
      if sy-subrc ne 0.
          select SUM( /N/S_STRDCOST )  into CORRESPONDING
          FIELDS OF wa_DSO_TABLE from
          /N/ADSP_DPIT00 WHERE /N/S_SALESITEM =  <rp>-/N/S_ITEMID AND
          /N/S_PLPLANT EQ <rp>-/N/S_SOURCE.
         if sy-subrc eq 0.
              <rp>-/N/S_STRDCOST = wa_DSO_TABLE-/N/S_STRDCOST.
         endif.
    endif.
    ENDLOOP.
    Any idea whats wrong with the code
    thanks

    Hi Vaidya,
    According to the code which you have written, there is no value in table IT_DSO_TABLE when you are trying to read the values.And after the read statement you have given a condition for sy-subrc. Hence the select statement is actually not even getting executed. *Also you have not assigned the final value back to the ResultPackage.*_
    So Kindly correct your code as follows:
    Data: wa_dso type ty_DSO_TABLE.
    LOOP AT RESULT_PACKAGE assigning <rp>.
    clear wa_DSO_TABLE.
    select SUM( /N/S_STRDCOST ) into CORRESPONDING
    FIELDS OF wa_DSO_TABLE from
    /N/ADSP_DPIT00 WHERE /N/S_SALESITEM = <rp>-/N/S_ITEMID AND
    /N/S_PLPLANT EQ <rp>-/N/S_SOURCE.
    if sy-subrc eq 0.
    <rp>-/N/S_STRDCOST = wa_DSO_TABLE-/N/S_STRDCOST.
    MODIFY RESULT_PACKAGE FROM <rp>.
    endif.
    ENDLOOP.
    Hope this helps you.
    Regards,
    Satyam

  • Performance Tunning of Sql query

    Hi,
    I have table A with size 120 Million and two more tables are of size 2 Million on Table B and less than 1 Million size on table C.
    I had created Partition and Parallel degree 4 on the table A. Created table B with Parallel degree 2 and Created table C with NOPARALLEL.
    My query is using above tables with joins and inserting into table D using HINT /*+ APPEND NOLOGGING*/
    I had executed the explain on the above criteria the cost is showing 20767.
    Later created Tables A,B and C with NOPARALLEL. Applied HINT on Table D /*+ APPEND NOLOGGING*/
    and als applied HINT /*+ PARALLEL(A, 4) PARALLEL(B C, 2) on select query which uses to insert into Table D.
    My question which is best practice on PARALLEL degree creation at table level or query level:
    a) Creating table with Paralle (degree 4)
    b) Applying HINT /*+ PARALLEL (TABLE A , 4) */ at query level
    Regards,
    Prakash

    957901 wrote:
    Hi,
    I have table A with size 120 Million and two more tables are of size 2 Million on Table B and less than 1 Million size on table C.
    I had created Partition and Parallel degree 4 on the table A. Created table B with Parallel degree 2 and Created table C with NOPARALLEL.
    My query is using above tables with joins and inserting into table D using HINT /*+ APPEND NOLOGGING*/
    I had executed the explain on the above criteria the cost is showing 20767. Cost is meaningless out of context.
    Later created Tables A,B and C with NOPARALLEL. Applied HINT on Table D /*+ APPEND NOLOGGING*/
    and als applied HINT /*+ PARALLEL(A, 4) PARALLEL(B C, 2) on select query which uses to insert into Table D.
    My question which is best practice on PARALLEL degree creation at table level or query level:
    a) Creating table with Paralle (degree 4)
    b) Applying HINT /*+ PARALLEL (TABLE A , 4) */ at query level Whichever works best for what you're needing to achieve.
    Which is another way of saying you haven't provided enough information for anyone here to make any informed decision or suggestion for you.
    {message:id=9360002}
    For performance issues/tuning requests, read the two threads linked to by this FAQ: {message:id=9360003}

  • Training classes for Administrator and Performance Tunning

    Hi All,
    I would like to learn more about ORACLE database so do you know any where offering the classes for Administrator and Performance Tunning in California Bay Area.
    THanks,
    JP

    Oracle. :-)
    http://education.oracle.com
    Alison

  • How to performance tune this query

    I need some inputs on how to do performance tuning on this query to improve performance.
    It takes around 45 secs to run. Is it possible to make any improvements in this by putting hints or writing in another way?
    select count(*)
    as nCount from A ,
    B ,
    C
    WHERE A.COL1 = B.COL1 AND
    A.COl2 <> 'COM' AND
    B.COL2 = C.COL1 AND
    B.COl3 IS NULL AND
    B.COL4 = 'TEST'
    This is the query plan:
    Operation Object Name Rows Bytes Cost Object Node In/Out PStart PStop
    SELECT STATEMENT Optimizer Mode=CHOOSE 1 51
    SORT AGGREGATE 1 37
    HASH JOIN 48 K 1 M 51
    TABLE ACCESS FULL A 68 K 998 K 32
    NESTED LOOPS 98 K 2 M 5
    TABLE ACCESS BY INDEX ROWID B 142 K 2 M 4
    INDEX SKIP SCAN XIF37B 142 K 6
    INDEX UNIQUE SCAN XPKC 1 5

    Mcka
    As well as EXPLAIN PLAN, let us know what proportion of rows are visited by this query. It may be that it is not using a full table scan when it should (or vice versa).
    And of course we'd need to know what indexes are available, and how selective they are for the predicated you have in this query ...
    Regards Nigel

  • 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

  • How to do Performance tunning in OBIEE

    Hi All,
    We are using OBIEE 10.3.4 version on windows envorinment .In our OBIEE project we are using 9 reports my requriment is we need to do performance tunning for OBIEE side.For eace report accessing its taking around 80 sec.We need to decrease these accessing time,is there any possibility to access all the reports with less response time in OBIEE side.
    Could you anyone suggest how to do performance tunning in OBIEE side.
    Thanks,
    Vijay.

    Vijay,
    Plz refer
    http://www.business-intelligence-quotient.com/?p=119
    http://prolynxuk.com/blog/?p=173
    http://businessdecisionsystems.com/blog/?p=486
    Here is the section from the BIEE admin guide:
    =======================
    Usage Examples
    This section provides a few examples of how to use Oracle hints in conjunction with the Oracle BI Server. For more information about Oracle hints, refer to the Oracle SQL Reference documentation for the version of the Oracle server that you use.
    Index Hint
    The Index hint instructs the optimizer to scan a specified index rather than a table. The following hypothetical example explains how you would use the Index hint. You find queries against the ORDER_ITEMS table to be slow. You review the query optimizer's execution plan and find the FAST_INDEX index is not being used. You create an Index hint to force the optimizer to scan the FAST_INDEX index rather than the ORDER_ITEMS table. The syntax for the Index hint is index(table_name, index_name). To add this hint to the repository, navigate to the Administration Tool's Physical Table dialog box and type the following text in the Hint field:
    index(ORDER_ITEMS, FAST_INDEX)
    Leading Hint
    The Leading hint forces the optimizer to build the join order of a query with a specified table. The syntax for the Leading hint is leading(table_name). If you were creating a foreign key join between the Products table and the Sales Fact table and wanted to force the optimizer to begin the join with the Products table, you would navigate to the Administration Tool's Physical Foreign Key dialog box and type the following text in the Hint field:
    leading(Products)
    So, the table names "order_items" and "products" in the above documentation will not be the same after BIEE puts aliases on them.
    ============
    Hope this is useful..
    Edited by: Deepak Gupta on Aug 1, 2011 7:18 AM

  • Performance Tune Stored procedures

    Hi Experts,
    What is the best approach to performance tune stored procedures. Is it to run expalin plan for the queries used in cursors or there is more to it?
    I need all your advise.
    Thanks

    As generic advice: Absolutely not.
    The performance of PL/SQL may be irrelevant to the performance of specific SQL statements contained.
    Consider the following:
    1. A very inefficient query that runs one time and takes 2 seconds to execute.
    2. A query that runs in 2 milliseconds inside a loop.
    Which one is more likely to be the issue?
    The answer is that it depends on the number of interations of the loop.
    The proper tool for tuning PL/SQL, as discussed by Tom Kyte, are, depending on version, DBMS_PROFILER or DBMS_HPROF.
    Find out where the time is being spent.
    Then tune that which takes the most time.
    It is not necessarily the slowest SQL statement.

Maybe you are looking for

  • Bind Variables and Shared Component Report Query

    I have a query in a region report which I have replicated to a shared component report query. Both queries reference page items as bind variables in the where clause. The report region on screen shows the correct results but the report query shows "n

  • IPOD causes PC to crash

    Hi there, hope someone can help figure out whats going on. I have a 3rd gen ipod (one before click wheel), black and white screen, it has been blissfully working perfectly for a few years now. Recently updated Itunes to 6.0.4 and ipod updater to 2.3.

  • Is there a possibility to disable the DESIGN MODE within BEx Analyzer 7.0?

    We need to disable the DESIGN MODE in the BEx Analyzer 7.0. Does someone know a possibility to restrict the access? Thanks in advance, Ulli

  • Scheduled Database Scripting

    I have an oracle 10g database and I want to setup a scheduled task on the Windows server that scripts the entire database (including schema, packages, data etc) to a text file. I do not want a database export and backup but a database script. Can you

  • Change dunning level in credits

    Hello @ll, a dunning proposal contain besides 3 invoices also a credit for the dunned customer. This credit contains dunning level 1 and I want to change it to 0 by double-clicking on the line in the output-list of the dunning proposal. But when I ch