Need pointers to improve performance of a select query to table vbrk

Hey Folks,
I have a query , whose performance needs to be tuned , as such:
    SELECT a~vbeln
           a~fkart                    
           a~waerk
           a~fkdat                   
           b~posnr
           b~vgbel
           b~vgpos
           b~matnr
           b~arktx
           b~prctr
           b~txjcd
      INTO TABLE gi_billing_items
      FROM vbrk AS a
      INNER JOIN vbrp AS b
      ON a~vbeln = b~vbeln
      FOR ALL ENTRIES IN gi_sales_items
     WHERE b~vgbel = gi_sales_items-vbeln
       AND b~vgpos  = gi_sales_items-posnr
       AND b~matnr  = gi_sales_items-matnr
       AND b~werks  = gi_sales_items-werks.
where
gi_sales_items is an internal table consisting of 278 entries,.
The result set collected in table gi_billing_items is 200 records
The total execution time for this query for the afore given data is 72,983 ms with the average time/record being ~ 9,471 ms which is too high.
When I try to verify the Explain Plan of the query in ST05, in the Access path I see that the performance of Query Block 1 is bad. Query Block 1 is of the QBLOCK_TYPE UNIONA. Its the very first step in the Query execution internally.
The indexes are defined on participating tables VBRK and VBRP as:
VBRK~0      MANDT,VBELN
VBRK~LOC MANDT,LCNUM
VBRP~0      MANDT,VBELN,POSNR
VBRP~Z01   FPLNR,MANDT
VBRP~Z02   MANDT,MATNR,WERKS
Its clear from the ST05, STAD and SE30 traces that there is a performance issue in this query. Does anyone have any pointers as to how to resolve this issue? Is there a protocol one needs to follow when using the "FOR ALL ENTRIES IN" clause? Or is there a need for any secondary indexes to be created?
Please let me know
Thanks and Best Regards,
Rashmi.

Hi,
Try using the VBFA...to get the Invoice number and line item..and then use that value in VBRK...
* Declare the internal table for T_VBFA.
IF NOT gi_sales_items[] IS INITIAL.
SELECT VBELV
              POSNV
              VBELN
              POSNN
              VBTYP_N
              INTO TABLE T_VBFA
              FOR ALL ENTRIES IN gi_sales_items
              WHERE VBELV = gi_sales_items-VBELN
              AND       POSNV = gi_sales_items-POSNR
              AND       VBTYP_N = 'M'.             "Invoice                       ""Added this..
ENDIF.
**Add two columns to GI_SALES_ITEMS..to store the VBELN POSNN the data from t_vbfa..let's assume it is VBELN_VF and POSNR_VF
* Basically merge gi_sales_items AND t_vbfa
** Then use that field in
IF NOT GI_SALES_ITEMS[] IS INITIAL.
      SELECT a~vbeln
           a~fkart                    
           a~waerk
           a~fkdat                   
           b~posnr
           b~vgbel
           b~vgpos
           b~matnr
           b~arktx
           b~prctr
           b~txjcd
      INTO TABLE gi_billing_items
      FROM vbrk AS a
      INNER JOIN vbrp AS b
      ON a~vbeln = b~vbeln
      FOR ALL ENTRIES IN gi_sales_items
      WHERE b~vbeln = gi_sales_items-vbeln_vf   " Change here
       AND b~posnr  = gi_sales_items-posnr_vf     " Change here
       AND b~matnr  = gi_sales_items-matnr
       AND b~werks  = gi_sales_items-werks.
ENDIF.
Thanks
Naren
Edited by: Narendran Muthukumaran on Oct 15, 2008 11:35 PM

Similar Messages

  • How to improve performance of the attached query

    Hi,
    How to improve performance of the below query, Please help. also attached explain plan -
    SELECT Camp.Id,
    rCam.AccountKey,
    Camp.Id,
    CamBilling.Cpm,
    CamBilling.Cpc,
    CamBilling.FlatRate,
    Camp.CampaignKey,
    Camp.AccountKey,
    CamBilling.billoncontractedamount,
    (SUM(rCam.Impressions) * 0.001 + SUM(rCam.Clickthrus)) AS GR,
    rCam.AccountKey as AccountKey
    FROM Campaign Camp, rCamSit rCam, CamBilling, Site xSite
    WHERE Camp.AccountKey = rCam.AccountKey
    AND Camp.AvCampaignKey = rCam.AvCampaignKey
    AND Camp.AccountKey = CamBilling.AccountKey
    AND Camp.CampaignKey = CamBilling.CampaignKey
    AND rCam.AccountKey = xSite.AccountKey
    AND rCam.AvSiteKey = xSite.AvSiteKey
    AND rCam.RmWhen BETWEEN to_date('01-01-2009', 'DD-MM-YYYY') and
    to_date('01-01-2011', 'DD-MM-YYYY')
    GROUP By rCam.AccountKey,
    Camp.Id,
    CamBilling.Cpm,
    CamBilling.Cpc,
    CamBilling.FlatRate,
    Camp.CampaignKey,
    Camp.AccountKey,
    CamBilling.billoncontractedamount
    Explain Plan :-
    Description Object_owner Object_name Cost Cardinality Bytes
    SELECT STATEMENT, GOAL = ALL_ROWS 14 1 13
    SORT AGGREGATE 1 13
    VIEW GEMINI_REPORTING 14 1 13
    HASH GROUP BY 14 1 103
    NESTED LOOPS 13 1 103
    HASH JOIN 12 1 85
    TABLE ACCESS BY INDEX ROWID GEMINI_REPORTING RCAMSIT 2 4 100
    NESTED LOOPS 9 5 325
    HASH JOIN 7 1 40
    SORT UNIQUE 2 1 18
    TABLE ACCESS BY INDEX ROWID GEMINI_PRIMARY SITE 2 1 18
    INDEX RANGE SCAN GEMINI_PRIMARY SITE_I0 1 1
    TABLE ACCESS FULL GEMINI_PRIMARY SITE 3 27 594
    INDEX RANGE SCAN GEMINI_REPORTING RCAMSIT_I 1 1 5
    TABLE ACCESS FULL GEMINI_PRIMARY CAMPAIGN 3 127 2540
    TABLE ACCESS BY INDEX ROWID GEMINI_PRIMARY CAMBILLING 1 1 18
    INDEX UNIQUE SCAN GEMINI_PRIMARY CAMBILLING_U1 0 1

    duplicate thread..
    How to improve performance of attached query

  • Needed help to improve the performance of a select query?

    Hi,
    I have been preparing a report which involves data to be fetched from 4 to 5 different tables and calculation has to performed on some columns also,
    i planned to write a single cursor to populate 1 temp table.i have used INLINE VIEW,EXISTS more frequently in the select query..please go through the query and suggest me a better way to restructure the query.
    cursor c_acc_pickup_incr(p_branch_code varchar2, p_applDate date, p_st_dt date, p_ed_dt date) is
    select sca.branch_code "BRANCH",
    sca.cust_ac_no "ACCOUNT",
    to_char(p_applDate, 'YYYYMM') "YEARMONTH",
    sca.ccy "CURRENCY",
    sca.account_class "PRODUCT",
    sca.cust_no "CUSTOMER",
    sca.ac_desc "DESCRIPTION",
    null "LOW_BAL",
    null "HIGH_BAL",
    null "AVG_CR_BAL",
    null "AVG_DR_BAL",
    null "CR_DAYS",
    null "DR_DAYS",
    --null                                 "CR_TURNOVER",       
    --null                                 "DR_TURNOVER",       
    null "DR_OD_DAYS",
    (select sum(gf.limit_amount * (scal.linkage_percentage / 100)) +
    (case when (p_applDate >= sca.tod_limit_start_date and
    p_applDate <= nvl(sca.tod_limit_end_date, p_applDate)) then
    sca.tod_limit else 0 end) dd
    from getm_facility gf, sttm_cust_account_linkages scal
    where gf.line_code || gf.line_serial = scal.linked_ref_no
    and cust_ac_no = sca.cust_ac_no) "OD_LIMIT",
    --sc.credit_rating                      "CR_GRADE",        
    null "AVG_NET_BAL",
    null "UNAUTH_OD_AMT",
    sca.acy_blocked_amount "AMT_BLOCKED",
    (select sum(amt)
    from ictb_entries_history ieh
    where ieh.acc = sca.cust_ac_no
    and ieh.brn = sca.branch_code
    and ieh.drcr = 'D'
    and ieh.liqn = 'Y'
    and ieh.entry_passed = 'Y'
    and ieh.ent_dt between p_st_dt and p_ed_dt
    and exists (
    select * from ictm_pr_int ipi, ictm_rule_frm irf
    where ipi.product_code = ieh.prod
    and ipi.rule = irf.rule_id
    and irf.book_flag = 'B')) "DR_INTEREST",
    (select sum(amt)
    from ictb_entries_history ieh
    where ieh.acc = sca.cust_ac_no
    and ieh.brn = sca.branch_code
    and ieh.drcr = 'C'
    and ieh.liqn = 'Y'
    and ieh.entry_passed = 'Y'
    and ieh.ent_dt between p_st_dt and p_ed_dt
    and exists (
    select * from ictm_pr_int ipi, ictm_rule_frm irf
    where ipi.product_code = ieh.prod
    and ipi.rule = irf.rule_id
    and irf.book_flag = 'B')) "CR_INTEREST",
    (select sum(amt) from ictb_entries_history ieh
    where ieh.brn = sca.branch_code
    and ieh.acc = sca.cust_ac_no
    and ieh.ent_dt between p_st_dt and p_ed_dt
    and exists (
    select product_code
    from ictm_product_definition ipd
    where ipd.product_code = ieh.prod
    and ipd.product_type = 'C')) "FEE_INCOME",
    sca.record_stat "ACC_STATUS",
    case when (trunc(sca.ac_open_date,'MM') = trunc(p_applDate,'MM')
    and not exists (select 1
    from ictm_tdpayin_details itd
    where itd.multimode_payopt = 'Y'
    and itd.brn = sca.branch_code
    and itd.acc = sca.cust_ac_no
    and itd.multimode_offset_brn is not null
    and itd.multimode_tdoffset_acc is not null))
    then 1 else 0 end "NEW_ACC_FOR_THE_MONTH",
    case when (trunc(sca.ac_open_date,'MM') = trunc(p_applDate,'MM')
    and trunc(sc.cif_creation_date,'MM') = trunc(p_applDate,'MM')
    and not exists (select 1
    from ictm_tdpayin_details itd
    where itd.multimode_payopt = 'Y'
    and itd.brn = sca.branch_code
    and itd.acc = sca.cust_ac_no
    and itd.multimode_offset_brn is not null
    and itd.multimode_tdoffset_acc is not null))
    then 1 else 0 end "NEW_ACC_FOR_NEW_CUST",
    (select 1 from dual
    where exists (select 1 from ictm_td_closure_renew itcr
    where itcr.brn = sca.branch_code
    and itcr.acc = sca.cust_ac_no
    and itcr.renewal_date = sysdate)
    or exists (select 1 from ictm_tdpayin_details itd
    where itd.multimode_payopt = 'Y'
    and itd.brn = sca.branch_code
    and itd.acc = sca.cust_ac_no
    and itd.multimode_offset_brn is not null
    and itd.multimode_tdoffset_acc is not null)) "RENEWED_OR_ROLLOVER",
    (select maturity_date from ictm_acc ia
    where ia.brn = sca.branch_code
    and ia.acc = sca.cust_ac_no) "MATURITY_DATE",
    sca.ac_stat_no_dr "DR_DISALLOWED",
    sca.ac_stat_no_cr "CR_DISALLOWED",
    sca.ac_stat_block                     "BLOCKED_ACC",       Not Reqd
    sca.ac_stat_dormant "DORMANT_ACC",
    sca.ac_stat_stop_pay "STOP_PAY_ACC", --New
    sca.ac_stat_frozen "FROZEN_ACC",
    sca.ac_open_date "ACC_OPENING_DT",
    sca.address1 "ADD_LINE_1",
    sca.address2 "ADD_LINE_2",
    sca.address3 "ADD_LINE_3",
    sca.address4 "ADD_LINE_4",
    sca.joint_ac_indicator "JOINT_ACC",
    sca.acy_avl_bal "CR_BAL",
    0 "DR_BAL",
    0 "CR_BAL_LCY", t
    0 "DR_BAL_LCY",
    null "YTD_CR_MOVEMENT",
    null "YTD_DR_MOVEMENT",
    null "YTD_CR_MOVEMENT_LCY",
    null "YTD_DR_MOVEMENT_LCY",
    null "MTD_CR_MOVEMENT",
    null "MTD_DR_MOVEMENT",
    null "MTD_CR_MOVEMENT_LCY",
    null "MTD_DR_MOVEMENT_LCY",
    'N' "BRANCH_TRFR", --New
    sca.provision_amount "PROVISION_AMT",
    sca.account_type "ACCOUNT_TYPE",
    nvl(sca.tod_limit, 0) "TOD_LIMIT",
    nvl(sca.sublimit, 0) "SUB_LIMIT",
    nvl(sca.tod_limit_start_date, global.min_date) "TOD_START_DATE",
    nvl(sca.tod_limit_end_date, global.max_date) "TOD_END_DATE"
    from sttm_cust_account sca, sttm_customer sc
    where sca.branch_code = p_branch_code
    and sca.cust_no = sc.customer_no
    and ( exists (select 1 from actb_daily_log adl
    where adl.ac_no = sca.cust_ac_no
    and adl.ac_branch = sca.branch_code
    and adl.trn_dt = p_applDate
    and adl.auth_stat = 'A')
    or exists (select 1 from catm_amount_blocks cab
    where cab.account = sca.cust_ac_no
    and cab.branch = sca.branch_code
    and cab.effective_date = p_applDate
    and cab.auth_stat = 'A')
    or exists (select 1 from ictm_td_closure_renew itcr
    where itcr.acc = sca.cust_ac_no
    and itcr.brn = sca.branch_code
    and itcr.renewal_date = p_applDate)
    or exists (select 1 from sttm_ac_stat_change sasc
    where sasc.cust_ac_no = sca.cust_ac_no
    and sasc.branch_code = sca.branch_code
    and sasc.status_change_date = p_applDate
    and sasc.auth_stat = 'A')
    or exists (select 1 from cstb_acc_brn_trfr_log cabtl
    where cabtl.branch_code = sca.branch_code
    and cabtl.cust_ac_no = sca.cust_ac_no
    and cabtl.process_status = 'S'
    and cabtl.process_date = p_applDate)
    or exists (select 1 from sttbs_provision_history sph
    where sph.branch_code = sca.branch_code
    and sph.cust_ac_no = sca.cust_ac_no
    and sph.esn_date = p_applDate)
    or exists (select 1 from sttms_cust_account_dormancy scad
    where scad.branch_code = sca.branch_code
    and scad.cust_ac_no = sca.cust_ac_no
    and scad.dormancy_start_dt = p_applDate)
    or sca.maker_dt_stamp = p_applDate
    or sca.status_since = p_applDate
    l_tb_acc_det ty_tb_acc_det_int;
    l_brnrec cvpks_utils.rec_brnlcy;
    l_acbr_lcy sttms_branch.branch_lcy%type;
    l_lcy_amount actbs_daily_log.lcy_amount%type;
    l_xrate number;
    l_dt_rec sttm_dates%rowtype;
    l_acc_rec sttm_cust_account%rowtype;
    l_acc_stat_row ty_r_acc_stat;
    Edited by: user13710379 on Jan 7, 2012 12:18 AM

    I see it more like shown below (possibly with no inline selects
    Try to get rid of the remaining inline selects ( left as an exercise ;) )
    and rewrite traditional joins as ansi joins as problems might arise using mixed syntax as I have to leave so I don't have time to complete the query
    select sca.branch_code "BRANCH",
           sca.cust_ac_no "ACCOUNT",
           to_char(p_applDate, 'YYYYMM') "YEARMONTH",
           sca.ccy "CURRENCY",
           sca.account_class "PRODUCT",
           sca.cust_no "CUSTOMER",
           sca.ac_desc "DESCRIPTION",
           null "LOW_BAL",
           null "HIGH_BAL",
           null "AVG_CR_BAL",
           null "AVG_DR_BAL",
           null "CR_DAYS",
           null "DR_DAYS",
    --     null "CR_TURNOVER",
    --     null "DR_TURNOVER",
           null "DR_OD_DAYS",
           w.dd "OD_LIMIT",
    --     sc.credit_rating "CR_GRADE",
           null "AVG_NET_BAL",
           null "UNAUTH_OD_AMT",
           sca.acy_blocked_amount "AMT_BLOCKED",
           x.dr_int "DR_INTEREST",
           x.cr_int "CR_INTEREST",
           y.fee_amt "FEE_INCOME",
           sca.record_stat "ACC_STATUS",
           case when trunc(sca.ac_open_date,'MM') = trunc(p_applDate,'MM')
                 and not exists(select 1
                                  from ictm_tdpayin_details itd
                                 where itd.multimode_payopt = 'Y'
                                   and itd.brn = sca.branch_code
                                   and itd.acc = sca.cust_ac_no
                                   and itd.multimode_offset_brn is not null
                                   and itd.multimode_tdoffset_acc is not null
                then 1
                else 0
           end "NEW_ACC_FOR_THE_MONTH",
           case when (trunc(sca.ac_open_date,'MM') = trunc(p_applDate,'MM')
                 and trunc(sc.cif_creation_date,'MM') = trunc(p_applDate,'MM')
                 and not exists(select 1
                                  from ictm_tdpayin_details itd
                                 where itd.multimode_payopt = 'Y'
                                   and itd.brn = sca.branch_code
                                   and itd.acc = sca.cust_ac_no
                                   and itd.multimode_offset_brn is not null
                                   and itd.multimode_tdoffset_acc is not null
                then 1
                else 0
           end "NEW_ACC_FOR_NEW_CUST",
           (select 1 from dual
             where exists(select 1
                            from ictm_td_closure_renew itcr
                           where itcr.brn = sca.branch_code
                             and itcr.acc = sca.cust_ac_no
                             and itcr.renewal_date = sysdate
                or exists(select 1
                            from ictm_tdpayin_details itd
                           where itd.multimode_payopt = 'Y'
                             and itd.brn = sca.branch_code
                             and itd.acc = sca.cust_ac_no
                             and itd.multimode_offset_brn is not null
                             and itd.multimode_tdoffset_acc is not null
           ) "RENEWED_OR_ROLLOVER",
           m.maturity_date "MATURITY_DATE",
           sca.ac_stat_no_dr "DR_DISALLOWED",
           sca.ac_stat_no_cr "CR_DISALLOWED",
    --     sca.ac_stat_block "BLOCKED_ACC", --Not Reqd
           sca.ac_stat_dormant "DORMANT_ACC",
           sca.ac_stat_stop_pay "STOP_PAY_ACC", --New
           sca.ac_stat_frozen "FROZEN_ACC",
           sca.ac_open_date "ACC_OPENING_DT",
           sca.address1 "ADD_LINE_1",
           sca.address2 "ADD_LINE_2",
           sca.address3 "ADD_LINE_3",
           sca.address4 "ADD_LINE_4",
           sca.joint_ac_indicator "JOINT_ACC",
           sca.acy_avl_bal "CR_BAL",
           0 "DR_BAL",
           0 "CR_BAL_LCY", t
           0 "DR_BAL_LCY",
           null "YTD_CR_MOVEMENT",
           null "YTD_DR_MOVEMENT",
           null "YTD_CR_MOVEMENT_LCY",
           null "YTD_DR_MOVEMENT_LCY",
           null "MTD_CR_MOVEMENT",
           null "MTD_DR_MOVEMENT",
           null "MTD_CR_MOVEMENT_LCY",
           null "MTD_DR_MOVEMENT_LCY",
           'N' "BRANCH_TRFR", --New
           sca.provision_amount "PROVISION_AMT",
           sca.account_type "ACCOUNT_TYPE",
           nvl(sca.tod_limit, 0) "TOD_LIMIT",
           nvl(sca.sublimit, 0) "SUB_LIMIT",
           nvl(sca.tod_limit_start_date, global.min_date) "TOD_START_DATE",
           nvl(sca.tod_limit_end_date, global.max_date) "TOD_END_DATE"
      from sttm_cust_account sca,
           sttm_customer sc,
           (select sca.cust_ac_no
                   sum(gf.limit_amount * (scal.linkage_percentage / 100)) +
                       case when p_applDate >= sca.tod_limit_start_date
                             and p_applDate <= nvl(sca.tod_limit_end_date, p_applDate)
                            then sca.tod_limit else 0
                       end
                      ) dd
              from sttm_cust_account sca
                   getm_facility gf,
                   sttm_cust_account_linkages scal
             where gf.line_code || gf.line_serial = scal.linked_ref_no
               and cust_ac_no = sca.cust_ac_no
             group by sca.cust_ac_no
           ) w,
           (select acc,
                   brn,
                   sum(decode(drcr,'D',amt)) dr_int,
                   sum(decode(drcr,'C',amt)) cr_int
              from ictb_entries_history ieh
             where ent_dt between p_st_dt and p_ed_dt
               and drcr in ('C','D')
               and liqn = 'Y'
               and entry_passed = 'Y'
               and exists(select null
                            from ictm_pr_int ipi,
                                 ictm_rule_frm irf
                           where ipi.rule = irf.rule_id
                             and ipi.product_code = ieh.prod 
                             and irf.book_flag = 'B'
             group by acc,brn
           ) x,
           (select acc,
                   brn,
                   sum(amt) fee_amt
              from ictb_entries_history ieh
             where ieh.ent_dt between p_st_dt and p_ed_dt
               and exists(select product_code
                            from ictm_product_definition ipd
                           where ipd.product_code = ieh.prod
                             and ipd.product_type = 'C'
             group by acc,brn
           ) y,
           ictm_acc m,
           (select sca.cust_ac_no,
                   sca.branch_code
                   coalesce(nvl2(coalesce(t1.ac_no,t1.ac_branch),'exists',null),
                            nvl2(coalesce(t2.account,t2.account),'exists',null),
                            nvl2(coalesce(t3.acc,t3.brn),'exists',null),
                            nvl2(coalesce(t4.cust_ac_no,t4.branch_code),'exists',null),
                            nvl2(coalesce(t5.cust_ac_no,t5.branch_code),'exists',null),
                            nvl2(coalesce(t6.cust_ac_no,t6.branch_code),'exists',null),
                            nvl2(coalesce(t7.cust_ac_no,t7.branch_code),'exists',null),
                            decode(sca.maker_dt_stamp,p_applDate,'exists'),
                            decode(sca.status_since,p_applDate,'exists')
                           ) existence
              from sttm_cust_account sca
                   left outer join
                   (select ac_no,ac_branch
                      from actb_daily_log
                     where trn_dt = p_applDate
                       and auth_stat = 'A'
                   ) t1
                on (sca.cust_ac_no = t1.ac_no
               and  sca.branch_code = t1.ac_branch
                   left outer join
                   (select account,account
                      from catm_amount_blocks
                     where effective_date = p_applDate
                       and auth_stat = 'A'
                   ) t2
                on (sca.cust_ac_no = t2.account
               and  sca.branch_code = t2.branch
                   left outer join
                   (select acc,brn
                      from ictm_td_closure_renew itcr
                     where renewal_date = p_applDate
                   ) t3
                on (sca.cust_ac_no = t3.acc
               and  sca.branch_code = t3.brn
                   left outer join
                   (select cust_ac_no,branch_code
                      from sttm_ac_stat_change
                     where status_change_date = p_applDate
                       and auth_stat = 'A'
                   ) t4
                on (sca.cust_ac_no = t4.cust_ac_no
               and  sca.branch_code = t4.branch_code
                   left outer join
                   (select cust_ac_no,branch_code
                      from cstb_acc_brn_trfr_log
                     where process_date = p_applDate
                       and process_status = 'S'
                   ) t5
                on (sca.cust_ac_no = t5.cust_ac_no
               and  sca.branch_code = t5.branch_code
                   left outer join
                   (select cust_ac_no,branch_code
                      from sttbs_provision_history
                     where esn_date = p_applDate
                   ) t6
                on (sca.cust_ac_no = t6.cust_ac_no
               and  sca.branch_code = t6.branch_code
                   left outer join
                   (select cust_ac_no,branch_code
                      from sttms_cust_account_dormancy
                     where dormancy_start_dt = p_applDate
                   ) t7
                on (sca.cust_ac_no = t7.cust_ac_no
               and  sca.branch_code = t7.branch_code
           ) z
    where sca.branch_code = p_branch_code
       and sca.cust_no = sc.customer_no
       and sca.cust_ac_no = w.cust_ac_no
       and sca.cust_ac_no = x.acc
       and sca.branch_code = x.brn
       and sca.cust_ac_no = y.acc
       and sca.branch_code = y.brn
       and sca.cust_ac_no = m.acc
       and sca.branch_code = m.brn
       and sca.cust_ac_no = z.sca.cust_ac_no
       and sca.branch_code = z.branch_code
       and z.existence is not nullRegards
    Etbin

  • Performance issue with select query and for all entries.

    hi,
    i have a report to be performance tuned.
    the database table has around 20 million entries and 25 fields.
    so, the report fetches the distinct values of two fields using one select query.
    so, the first select query fetches around 150 entries from the table for 2 fields.
    then it applies some logic and eliminates some entries and makes entries around 80-90...
    and then it again applies the select query on the same table using for all entries applied on the internal table with 80-90 entries...
    in short,
    it accesses the same database table twice.
    so, i tried to get the database table in internal table and apply the logic on internal table and delete the unwanted entries.. but it gave me memory dump, and it wont take that huge amount of data into abap memory...
    is around 80-90 entries too much for using "for all entries"?
    the logic that is applied to eliminate the entries from internal table is too long, and hence cannot be converted into where clause to convert it into single select..
    i really cant find the way out...
    please help.

    chinmay kulkarni wrote:Chinmay,
    Even though you tried to ask the question with detailed explanation, unfortunately it is still not clear.
    It is perfectly fine to access the same database twice. If that is working for you, I don't think there is any need to change the logic. As Rob mentioned, 80 or 8000 records is not a problem in "for all entries" clause.
    >
    > so, i tried to get the database table in internal table and apply the logic on internal table and delete the unwanted entries.. but it gave me memory dump, and it wont take that huge amount of data into abap memory...
    >
    It is not clear what you tried to do here. Did you try to bring all 20 million records into an internal table? That will certainly cause the program to short dump with memory shortage.
    > the logic that is applied to eliminate the entries from internal table is too long, and hence cannot be converted into where clause to convert it into single select..
    >
    That is fine. Actually, it is better (performance wise) to do much of the work in ABAP than writing a complex WHERE clause that might bog down the database.

  • Performance of the select query

    i want to know wheter the conversion of  the select query
    SELECT  * FROM mchb                        
            WHERE matnr EQ mch1-matnr
            AND   charg EQ mch1-charg
            AND   werks EQ plant-werks.
            itab-lgort = mchb-lgort.
            itab-clabs = mchb-clabs.
            APPEND itab.
          ENDSELECT.
    into following pattern
    select lgort clabs
           from mchb
           into corresponding fields of itab
           WHERE matnr EQ mch1-matnr
           AND   charg EQ mch1-charg
           AND   werks EQ plant-werks.
           ENDSELECT.
    will give  the same results ?

    Hi,
    It will results in performance issue because of end select statement.
    select lgort clabs
         from mchb
            into table itab
            WHERE matnr EQ mch1-matnr
                  AND charg EQ mch1-charg
                  AND werks EQ plant-werks.
    Use like this you will get the values of lgort and clabs in the internal table itab.
    Then use loop statement to use that values further.
    Dont use end select it will be a performance issue.
    In this code there is no need to use of ENDSELECT and use corresponding fields of table itab.
    select lgort clabs
    from mchb
    into corresponding fields of itab
    WHERE matnr EQ mch1-matnr
    AND charg EQ mch1-charg
    AND werks EQ plant-werks.
    ENDSELECT.
    Thanks,
    Sakthi

  • Performance Problem in Select query

    Hi,
    I have performance Problem in following Select Query :
    SELECT VBELN POSNR LFIMG VRKME VGBEL VGPOS
      FROM LIPS INTO CORRESPONDING FIELDS OF TABLE GT_LIPS
       FOR ALL ENTRIES IN GT_EKPO1
       WHERE VGBEL = GT_EKPO1-EBELN
         AND VGPOS = GT_EKPO1-EBELP.
    as per trace i have analysed that it is fetch the complete table scan from the LIPS table and table contants almost 3 lakh records.
    Kindly Suggest what we can do to optimize this query.
    Regards,
    Harsh

    types: begin of line,
              vbeln type lips-vbeln
              posnr type lips-posnr
              lfimg type lips-lfimg
             vrkme type lips-vrkme
             vgbel type lips- vgbel
             vgpos type lips-vgpos
             end of line.
    data: itab type standard table of line,
             wa type line.
    IF GT_EKPO1[] IS NOT INITIAL.
    SELECT VBELN POSNR LFIMG VRKME VGBEL VGPOS
    FROM LIPS INTO  TABLE ITAB
    FOR ALL ENTRIES IN GT_EKPO1
    WHERE VGBEL = GT_EKPO1-EBELN
    AND VGPOS = GT_EKPO1-EBELP.
    ENDIF.

  • Poor performance due to select query

    Hey ppl,
    I am facing a problem in one of the select query on BSEG.
    The query is as given
    TYPES :BEGIN OF wa1_bseg,
            bukrs    TYPE bseg-bukrs,
            belnr     TYPE bseg-belnr,     
            gjahr         TYPE bseg-gjahr,
            buzei    TYPE bseg-buzei,
            fwbas    TYPE bseg-fwbas ,     
            pswbt    TYPE bseg-pswbt,
            hkont    TYPE bseg-hkont,
            wrbtr     TYPE bseg-wrbtr,
            ktosl     TYPE bseg-ktosl,
            koart     TYPE bseg-koart,
            shkzg    TYPE bseg-shkzg,
            mwskz   TYPE bseg-mwskz,
            qsskz    TYPE bsis-qsskz,
            dmbtr     TYPE bseg-dmbtr,
            flag        TYPE C,
            END OF wa1_bseg.
    DATA: it_bsegv TYPE TABLE OF wa1_bseg WITH HEADER LINE.
    SELECT bukrs belnr gjahr buzei fwbas pswbt hkont wrbtr  ktosl shkzg koart mwskz
    FROM bseg INTO TABLE it_bsegv
    FOR ALL ENTRIES IN it_ekko
       WHERE bukrs = 'MU51'     AND
                    gjahr IN s_fiscal    AND
                    valut IN s_budat1  AND
                    ebeln = it_ekko-ebeln.
    Even if there are only around 5 records in it_ekko it takes very long time in executing. Sumtimes it even shows 'time out' in
    foreground.   Kindly help me out with it

    Hi,
    Go through this link it will helpful,
    Re: Performance Issue with BKPF, BSEG, BSET
    Re: Reading BSEG: performance problems
    /people/rob.burbank/blog/2007/11/12/quickly-retrieving-fi-document-data-from-bseg
    Regards
    Adil
    Edited by: Syed  Abdul Adil on Jun 17, 2008 12:33 PM

  • Performance issue with select query

    Hi friends ,
    This is my select query which is taking so much time to retrive the records.CAn Any one help me in solving this performance issue.
    *- Get the Goods receipts  mainly selected per period (=> MKPF secondary
      SELECT msegebeln msegebelp mseg~werks
             ekkobukrs ekkolifnr ekkozterm ekkoekorg ekko~ekgrp
             ekkoinco1 ekkoexnum
             lfa1name1 lfa1land1 lfa1ktokk lfa1stceg
             mkpfmblnr mkpfmjahr msegzeile mkpfbldat mkpf~budat
             mseg~bwart
    *Start of changes for CIP 6203752 by PGOX02
             mseg~smbln
    *End of changes for CIP 6203752 by PGOX02
             ekpomatnr ekpotxz01 ekpomenge ekpomeins
             ekbemenge ekbedmbtr ekbewrbtr ekbewaers
             ekpolgort ekpomatkl ekpowebaz ekpokonnr ekpo~ktpnr
             ekpoplifz ekpobstae
             INTO TABLE it_temp
        FROM mkpf JOIN mseg ON msegmblnr EQ mkpfmblnr
                           AND msegmjahr EQ mkpfmjahr
                  JOIN ekbe ON ekbeebeln EQ msegebeln
                           AND ekbeebelp EQ msegebelp
                           AND ekbe~zekkn EQ '00'
                           AND ekbe~vgabe EQ '1'
                           AND ekbegjahr EQ msegmjahr
                           AND ekbebelnr EQ msegmblnr
                           AND ekbebuzei EQ msegzeile
                  JOIN ekpo ON ekpoebeln EQ ekbeebeln
                           AND ekpoebelp EQ ekbeebelp
                  JOIN ekko ON ekkoebeln EQ ekpoebeln
                  JOIN lfa1 ON lfa1lifnr EQ ekkolifnr
        WHERE mkpf~budat IN so_budat
          AND mkpf~bldat IN so_bldat
          AND mkpf~vgart EQ 'WE'
          AND mseg~bwart IN so_bwart
          AND mseg~matnr IN so_matnr
          AND mseg~werks IN so_werks
          AND mseg~lifnr IN so_lifnr
          AND mseg~ebeln IN so_ebeln
          AND ekko~ekgrp IN so_ekgrp
          AND ekko~bukrs IN so_bukrs
          AND ekpo~matkl IN so_matkl
          AND ekko~bstyp IN so_bstyp
          AND ekpo~loekz EQ space
          AND ekpo~plifz IN so_plifz.
    Thanks & Regards,
    Manoj Kumar .Thatha
    Moderator message - Please see Please Read before Posting in the Performance and Tuning Forum before posting and please use code tags when posting code - post locked
    Edited by: Rob Burbank on Feb 4, 2010 9:03 AM

    Hi friends ,
    This is my select query which is taking so much time to retrive the records.CAn Any one help me in solving this performance issue.
    *- Get the Goods receipts  mainly selected per period (=> MKPF secondary
      SELECT msegebeln msegebelp mseg~werks
             ekkobukrs ekkolifnr ekkozterm ekkoekorg ekko~ekgrp
             ekkoinco1 ekkoexnum
             lfa1name1 lfa1land1 lfa1ktokk lfa1stceg
             mkpfmblnr mkpfmjahr msegzeile mkpfbldat mkpf~budat
             mseg~bwart
    *Start of changes for CIP 6203752 by PGOX02
             mseg~smbln
    *End of changes for CIP 6203752 by PGOX02
             ekpomatnr ekpotxz01 ekpomenge ekpomeins
             ekbemenge ekbedmbtr ekbewrbtr ekbewaers
             ekpolgort ekpomatkl ekpowebaz ekpokonnr ekpo~ktpnr
             ekpoplifz ekpobstae
             INTO TABLE it_temp
        FROM mkpf JOIN mseg ON msegmblnr EQ mkpfmblnr
                           AND msegmjahr EQ mkpfmjahr
                  JOIN ekbe ON ekbeebeln EQ msegebeln
                           AND ekbeebelp EQ msegebelp
                           AND ekbe~zekkn EQ '00'
                           AND ekbe~vgabe EQ '1'
                           AND ekbegjahr EQ msegmjahr
                           AND ekbebelnr EQ msegmblnr
                           AND ekbebuzei EQ msegzeile
                  JOIN ekpo ON ekpoebeln EQ ekbeebeln
                           AND ekpoebelp EQ ekbeebelp
                  JOIN ekko ON ekkoebeln EQ ekpoebeln
                  JOIN lfa1 ON lfa1lifnr EQ ekkolifnr
        WHERE mkpf~budat IN so_budat
          AND mkpf~bldat IN so_bldat
          AND mkpf~vgart EQ 'WE'
          AND mseg~bwart IN so_bwart
          AND mseg~matnr IN so_matnr
          AND mseg~werks IN so_werks
          AND mseg~lifnr IN so_lifnr
          AND mseg~ebeln IN so_ebeln
          AND ekko~ekgrp IN so_ekgrp
          AND ekko~bukrs IN so_bukrs
          AND ekpo~matkl IN so_matkl
          AND ekko~bstyp IN so_bstyp
          AND ekpo~loekz EQ space
          AND ekpo~plifz IN so_plifz.
    Thanks & Regards,
    Manoj Kumar .Thatha
    Moderator message - Please see Please Read before Posting in the Performance and Tuning Forum before posting and please use code tags when posting code - post locked
    Edited by: Rob Burbank on Feb 4, 2010 9:03 AM

  • Performance optimization on select query for all entries

    Hi All,
          I want to optimize the select query in my Program.
         The select query is taking lot of time to search the records for the given condition in the where clause
         and more interestingly there are no records fetched from the database as the where condition does not matches. 
         It is taking more than 30 min to search the record and the result is no record found.
         Below is my select query. I have also created the secondary Index for the same.
         In My opinion FOR ALL ENTRIES is taking lot of time. Because there are more than 1200 records in internal table t_ajot     
          select banfn  bnfpo     bsart      txz01   matnr   Werks   lgort     matkl    reswk   menge     meins   flief      ekorg  
              INTO CORRESPONDING FIELDS OF TABLE t_req
              FROM eban
                FOR ALL ENTRIES IN t_ajot
              WHERE matkl >= t_ajot-matkl_low
                AND matkl <= t_ajot-matkl_high
                AND werks = t_ajot-werks
                AND loekz = ' '
                AND badat IN s_badat
                AND bsart = 'NB'.  
        Please suggest.

    Hi,
    that,
    FOR ALL ENTRIES IN t_ajot
    WHERE matkl >= t_ajot-matkl_low
    AND matkl <= t_ajot-matkl_high
    AND werks = t_ajot-werks
    AND loekz = ' '
    AND badat IN s_badat
    AND bsart = 'NB'.
    looks strange.
    However:
    How does your index look like?
    What executoin plan do you get?
    How do the statistics look like?
    Whats the content of the variables t_ajot-... and s_badata?
    Kind regards,
    Hermann

  • Error While Firing select Query  on Table

    Hi aill,
    we have Oracle 11g RG2 RAC on Production Machine. When I am firing select query on one partiton table,it will show me below error in Alter Log file :
    Exception [type: SIGSEGV, Address not mapped to object] [ADDR:0x0] [PC:0x84056AA, kkpamDInfo()+38] [flags: 0x0, count: 1]
    Errors in file /opt/app/oracle/diag/rdbms/winsdb/WINSDB2/trace/WINSDB2_ora_29686.trc (incident=288563):
    ORA-07445: exception encountered: core dump [kkpamDInfo()+38] [SIGSEGV] [ADDR:0x0] [PC:0x84056AA] [Address not mapped to object] []
    Incident details in: /opt/app/oracle/diag/rdbms/winsdb/WINSDB2/incident/incdir_288563/WINSDB2_ora_29686_i288563.trc
    While checking the trace file :
    ========== FRAME [2] (ksedst1()+98 -> skdstdst()) ==========
    defined by frame pointers 0x2ba371efaa40 and 0x2ba371efa990
    CALL TYPE: call ERROR SIGNALED: no COMPONENT: KSE
    RDI 0000000000000000 RSI 0000000000000000 RDX 00002BA371EF6118
    RCX 0000000000000001 R8 0000000000000000 R9 0000000000000000
    RAX 0000000000000000 RBX 0000000000000003 RBP 00002BA371EFAA40
    R10 71EFA9A000000000 R11 0000000000000000 R12 0000000000000003
    R13 0000000000000003 R14 0000000000000001 R15 0000000000000001
    RSP 00002BA371EFA9A0 RIP 000000000349E72E
    Dump of memory from 0x2ba371efaa40 to 0x2ba371efaaf0
    2BA371EFAA40 71EFAB10 00002BA3 0349E77F 00000000 [...q.+....I.....]
    2BA371EFAA50 00000000 00000000 00000000 00000000 [................]
    2BA371EFAA60 71B996F0 00002BA3 02050034 00000000 [...q.+..4.......]
    2BA371EFAA70 000000FF 00002BA3 00002004 00000000 [.....+... ......]
    2BA371EFAA80 00000000 00000000 2338D058 00016DAB [........X.8#.m..]
    2BA371EFAA90 00000003 00000000 085232F3 00000000 [.........2R.....]
    2BA371EFAAA0 0000000D 00000000 00000002 00000000 [................]
    2BA371EFAAB0 00000000 00000000 00000000 00000000 [................]
    2BA371EFAAC0 71EFAAD0 00002BA3 085BBFCF 00000000 [...q.+....[.....]
    2BA371EFAAD0 71EFAB10 00002BA3 0349E249 00000000 [...q.+..I.I.....]
    2BA371EFAAE0 00000000 00002BA3 00000013 00000000 [.....+..........]
    Can Anyone guide me for above Errors. How can I resolve the same.

    A quick search of Oracle Support shows that there are a handful of bugs that match ORA-07445 with an argument of kkpamDInfo()+38.
    Whether yours is already identified and patched depends on the exact version of 11.2 and the specific circumstances.
    If you're on 11.2.0.1 then this might be part of what sounds like quite a big bucket of such errors - Bug 9399991 relating to errors and dumps with SQL against partitioned tables.

  • Select query on table rcv_lots_interface is always returning null

    Hi ,
    I need a help on the below issue.
    The issue is after creating PO in Oracle 11i I receive it in MSCA application.
    When we receive it at that point data gets inserted in the table " rcv_transactions_interface " and we have written a trigger on it.
    From the trigger on table " rcv_transactions_interface " we are calling a package and in the package we have select query on "rcv_lots_interface."
    But the select query is always returning null even though we are passing the correct "interface_transaction_id " and also after the "Receiving Transaction Processor" is executed i can see data in the table " RCV_LOT_TRANSACTIONS " for the same transaction.
    Below is the sample code i am using.
    CREATE OR REPLACE TRIGGER inv.RCV_TRAN_TRIGGER
    AFTER UPDATE
    ON po.rcv_transactions_interface
    FOR EACH ROW
    WHEN (NEW.processing_status_code='PENDING'
    AND NEW.destination_type_code IN ('INVENTORY','RECEIVING')
    AND NEW.mobile_txn = 'Y')
    DECLARE
    PRAGMA AUTONOMOUS_TRANSACTION;
    v_user_id NUMBER;
    v_interface_transaction_id NUMBER;
    v_organization_id NUMBER;
    v_item_id NUMBER;
    v_quantity NUMBER;
    v_resp_id NUMBER;
    v_mobile_txn VARCHAR2(5);
    v_shipment_header_id NUMBER;
    v_bill_of_lading VARCHAR2(100);
    v_group_id NUMBER;
    v_header_interface_id NUMBER;
    BEGIN
    v_interface_transaction_id := :NEW.interface_transaction_id;
    v_organization_id := :NEW.to_organization_id;
    v_user_id := :NEW.created_by;
    v_item_id := :NEW.item_id;
    v_quantity := :NEW.quantity;
    v_resp_id :=fnd_profile.VALUE('RESP_ID');
    v_transaction_type := :NEW.transaction_type;
    v_mobile_txn := :NEW.mobile_txn;
    v_bill_of_lading := :NEW.bill_of_lading;
    v_group_id := :NEW.group_id;
    v_header_interface_id := :NEW.HEADER_INTERFACE_ID;
    INV.INV_RCV_TRX_PKG.INV_RCV_LABEL_GEN_PRC( v_user_id,
    v_interface_transaction_id,
    v_item_id,
    v_quantity,
    v_organization_id,
    v_resp_id,
    v_shipment_header_id,
    v_bill_of_lading,
    v_header_interface_id,
    v_group_id);
    END;
    CREATE OR REPLACE PACKAGE BODY INV.INV_RCV_TRX_PKG
    AS
    PROCEDURE INV_RCV_LABEL_GEN_PRC( p_user_id IN NUMBER,
    p_interface_transaction_id IN NUMBER,
    p_item_id IN NUMBER,
    p_quantity IN NUMBER,
    p_organization_id IN NUMBER,
    p_resp_id IN NUMBER,
    p_shipment_header_id IN NUMBER,
    p_bill_of_lading IN VARCHAR2,
    p_header_interface_id IN NUMBER ,
    p_group_id IN NUMBER
    IS
    v_user_id NUMBER;
    v_print BOOLEAN;
    v_resp_id NUMBER;
    v_resp_appl_id NUMBER;
    v_lot_num VARCHAR2(50);
    BEGIN
    BEGIN
    SELECT application_id
    INTO v_resp_appl_id
    FROM apps.fnd_responsibility_tl frt
    WHERE responsibility_id=p_resp_id;
    END;
    apps.fnd_global.apps_initialize(p_user_id, p_resp_id, v_resp_appl_id);
    BEGIN
    SELECT rli.lot_num , rli.expiration_date
    INTO v_lot_num ,
    v_expiration_date
    FROM apps.rcv_lots_interface rli
    WHERE rli.interface_transaction_id = p_interface_transaction_id ;
    EXCEPTION
    WHEN OTHERS THEN
    v_lot_num :=NULL;
    v_expiration_date :=NULL;
    apps.fnd_file.put_line(fnd_file.log,'Exception while deriving LOT Number ######### '||p_interface_transaction_id||'------'||SQLERRM);
    END;
    END;
    Need your help to understand why the below query is always returning null and what is the solution for it ?
    SELECT rli.lot_num , rli.expiration_date
    FROM apps.rcv_lots_interface rli
    WHERE rli.interface_transaction_id = p_interface_transaction_id ;
    Thanks
    Jaydeep
    Edited by: user10454886 on Mar 25, 2013 6:31 AM
    Hi ,
    I need a solution to this issue at the earliest.
    Appreciate all of your help
    Thanks
    Jaydeep

    Centinul wrote:
    There are a lot of bugs listed in Metalink with respect to wrong results and function-based indexes.
    Here are a few:
    Bug 4028186 Wrong results if function based index exists
    Bug 4717546 Wrong results / poor plan when function based index exists
    Bug 5092688 Wrong results if function based index exists
    Based on reviewing them the workarounds range from dropping the index to setting "_disable_function_based_index" to TRUE.Facinating. It seems to me that if you use the undocumented intitialization parameter you might just as well drop the FBIs too.
    Another hazard of FBIs is the Law of Unintended Consequences. 2 years ago we tried to use one to speed up a query in a PL/SQL package. Worked OK for that purpose, but an unrelated loader on the affected table ran and rand but never finished until the FBI was dropped.

  • Plz help, A select query for table giving foll o/p

    A table has a single column with following data
    Col1
    170
    10
    140
    520
    20
    60
    70
    The select query should return the data in the following format
    Col1 Col2 Col3 Col4
    170 3 1 0
    10 0 0 1
    140 2 2 0
    520 10 1 0
    20 0 1 0
    60 1 0 1
    70 1 1 0

    Using my awesome puzzle solving brain I note that Col2 = 50 Col3 = 20 Col4 = 10.
    But you should be telling US that.
    select col1, floor(col1/50) col2, floor(mod(col1,50)/20) col3, floor(mod(mod(col1,50),20)/10) col4
    from mytable.
    I win the internets!
    Edited by: Dave Hemming on Dec 19, 2008 11:35 AM

  • Select Query LQUA Table

    Hi Experts
    Can Any one tell me ,
    Is there anything wrong in this select query, As per my knoledge everything is Fine, But Still i am getting SY-SUBRC = 4 for this Query,
    Its a Warehouse Management table LQUA i have Used.
    TABLES:mara,lqua.
    *Internal Table And Work Area Declearation
    DATA: it_lqua1 TYPE TABLE OF lqua WITH HEADER LINE.
    DATA: wa_tmp_lqua TYPE lqua.
    CONSTANTS: c_x TYPE char1 VALUE 'X',
               c_t TYPE char1 VALUE 'Q'.
    *Selection Screen
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    PARAMETERS:P_HLDR TYPE lqua-Z_HLDREF1.
    SELECT-OPTIONS:s_matnr FOR mara-matnr,
                   s_date  FOR sy-datum DEFAULT sy-datum,
                   s_mfgt  FOR sy-uzeit DEFAULT sy-uzeit,
                   s_CHARG FOR lqua-CHARG.
    SELECTION-SCREEN END OF BLOCK blk1.
    START-OF-SELECTION.
    Select * from LQUA
                into table IT_LQUA1
                where MATNR in S_MATNR
                and BDATU in S_DATE
                and Z_MFGTIM in S_MFGT
                   AND CHARG IN S_CHARG.
    After Debuging Above Query I am Getting SY-SUBRC = 4.
    Same data is availabe In LQUA Table For Selection Criteria..
    Please help me if anyone has worked on WM LQUA Table

    Hi
    as per your code you are mentioning S_DATE and S_MFGT which is system date and username.
    i beleive you do not have data for this user name and this date in your table LQUA. that why you are getting sy-subrc = 4
    because all this is in the where condition with AND operator. So all the conditions should be matched otherwise you will not find any data.
    so check your table once again for the given values, like your system date and the current user name.
    Thanks
    Lalit Gupta

  • EP6 sp12 Performance Issue, Need help to improve performance

    We have a Portal development environment with EP6.0 sp12.
    What we are experiencing is performance issue, It's not extremely slow, but slow compared to normal ( compared to our prod box). For example, after putting the username and password and clicking the <Log on> Button it's taking more than 10 secs for the first home page to appear. Also currently we have hooked the Portal with 3 xAPPS system and one BW system. The time taken for a BW query to appear ( with selection screen) is also more than 10 secs. However access to one other xAPPS is comparatively faster.
    Do we have a simple to use guide( Not a very elaborate one) with step by step guidance to immediately improve the performance of the Portal.
    Simple guide, easy to implement,  with immediate effect is what we are looking for in the short term
    Thanks
    Arunabha

    Hi Eric,
      I have searched but didn't find the Portal Tuning and Optimization Guide as you have suggested, Can you help to find this.
    Subrato,
      This is good and I would obviously read through this, The issue here is this is only for Network.
      But do you know any other guide, which as very basic ( may be 10 steps) and show step by step the process, it would be very helpful. I already have some information from the thread Portal Performance - page loads slow, client cache reset/cleared too often
    But really looking for answer ( steps to do it quickly and effectively) instead of list of various guides.
    It would be very helpful if you or anybody( who has actually done some performance tuning) can send  a basic list of steps that I can do immediately, instead of reading through these large guides.
    I know I am looking for a shortcut, but this is the need of the hour.
    Thanks
    Arun

  • Explain plan : need advice in improving performance

    Hi,
    DB : 10.2.0.4
    platform: Solaris
    SGA: 8 G
    one of my query is taking too much time, explain plan gives below output.
    kindly advise what i can do to improve the performance
    PLAN_TABLE_OUTPUT
    Plan hash value: 430877948
    | Id  | Operation                    | Name                          | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT             |                               |  8143 | 1081K| 31130   (1)| 00:06:14 |
    |*  1 | FILTER | |       |       |            |          |
    |*  2 | TABLE ACCESS BY INDEX ROWID| ID_TICKET_DETAILS             |  8143 | 1081K|   494   (0)| 00:00:06 |
    |*  3 | INDEX SKIP SCAN           | TKT_IDX_21                    |     1 | |   493   (0)| 00:00:06 |
    |*  4 | TABLE ACCESS BY INDEX ROWID| ID_DELIVERY_DEBIT_SLIP_DETAIL |     1 | 34 |     3   (0)| 00:00:01 |
    |   5 | NESTED LOOPS              |                               |     2 | 124 |     7   (0)| 00:00:01 |
    |*  6 | TABLE ACCESS FULL        | ID_DELIVERY_DEBIT_SLIP_HEADER | 32243 | 881K|     2   (0)| 00:00:01 |
    |*  7 | INDEX RANGE SCAN         | DSD_DELIVERY_DEBIT_UKEY       |     1 | |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter( NOT EXISTS (SELECT /*+ */ 0 FROM "ID_DELIVERY_DEBIT_SLIP_HEADER"
    "ID_DELIVERY_DEBIT_SLIP_HEADER","ID_DELIVERY_DEBIT_SLIP_DETAIL" "ID_DELIVERY_DEBIT_SLIP_DETAIL" WHERE
    "DSH_DOCUMENT_NUMBER"="DSD_DOCUMENT_NUMBER" AND "DSH_DOCUMENT_TYPE"="DSD_DOCUMENT_TYPE" AND
    "DSH_COMPANY"="DSD_COMPANY" AND "DSD_TICKET_NUMBER" IS NOT NULL AND
    LNNVL(:B1||:B2<>"DSD_AIRLINE"||"DSD_TICKET_NUMBER") AND "DSH_DELIVERY_DEBIT"='DEBIT'))
       2 - filter((:1 IS NULL OR "TICKET_AIRLINE"=:2) AND "TICKET_REFERENCE_2" IS NULL AND
    "TICKET_RECEIPT_NUMBER" IS NULL AND "TICKET_CARD_RECEIPT_NUMBER" IS NULL AND
    "TICKET_SYSTEM_DOC_NUMBER" IS NULL)
       3 - access("TICKET_REFERENCE_1" IS NULL)
           filter("TICKET_REFERENCE_1" IS NULL AND TO_NUMBER("TICKET_COMPANY")=1)
       4 - filter("DSD_TICKET_NUMBER" IS NOT NULL AND LNNVL(:B1||:B2<>"DSD_AIRLINE"||"DSD_TICKET_NUMBER"))
       6 - filter("DSH_DELIVERY_DEBIT"='DEBIT')
       7 - access("DSH_COMPANY"="DSD_COMPANY" AND "DSH_DOCUMENT_TYPE"="DSD_DOCUMENT_TYPE" AND
    "DSH_DOCUMENT_NUMBER"="DSD_DOCUMENT_NUMBER")
    Note
       - SQL profile "SYS_SQLPROF_014f902e2ea4c002" used for this statement

    some comments:
    it would be more simple to read the plan with indentatitions: you could use a fixed-width font
    it's hard to tell much about the plan without seeing the corresponding query (though in this case the predicate section gives some information on the query - especially step 1)
    the plan shows the use of a sql profile: so the CBO uses additional statistics to generate the plan
    in step 3 there is an index skip scan: that's only a good idea if there are few distinct values for the leading column of the index and the selectivity of "TICKET_REFERENCE_1" IS NULL is good
    in step 6 there is a Full Table Scan for the driving table of a nested loops join: the cost value for the scan is very small and so is the cost for the complete NL join - and that could be misleading
    I would use the gather_plan_statistics hint to get a plan with rowsource statistics to check if the cardinalities the CBO works with are correct. If they are not you could try to disable the profile (or create a new profile; of course after checking who created the profile and for what reasons). With an accurate sql profile the CBO should have enough information to create an accurate plan in most cases.
    Regards
    Martin

Maybe you are looking for

  • Condition type RA00

    hello, i created a Purchase order and i used the discount condition type RA00 and the discount is appearing on the PO. Is there a way i can deactivate it. I do not want the discount amount to show on the Purchase Order. Urgent help needed.

  • Make Revision Level Case Sensitive

    Hi, I am creating a new revision level for a material under a change number. Under that same change number I am changing the BOM and routing for the new revision level of the material. We use the drawing number of the material as the Material Number.

  • HT201071 Please add support for Camera RAW Canon PowerShot G2

    Please add support for Camera RAW Canon PowerShot G2, it may be ancient, but there are still a lot of G2s out there, and it's annoying to have a different workflow for pictures from them... best, case

  • Workflow: call transaction CJ20N not displaying customized screen

    Experts, My workflow needs to call transaction CJ20N. so that the user can accept a customized field on the project display. When I called the transaction, I did not see the customized fields on the display. I need to call transaction CJ20N that will

  • Can't find my working wired telephone in device list

    I have the ea4500 N900 router running version 2.1.39.145204. I use a ooma (ooma.com) telephone box that connects to the router (wired) It does not show up in the device list, I do not see the mac address on the list but the phone works. at one time I