Just a helpful SAP note for slow SQL statements

Hi Guys,
Just wanted to share this SAP note with you. I am sure many of you might have gone through it.
[SAP Note 155413 - Analysis of slow SQL statements|https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=155413]
Cheers,
Abu

>
ZAFCO ABAP wrote:
> Hi Guys,
>
> Just wanted to share this SAP note with you. I am sure many of you might have gone through it.
>
> [SAP Note 155413 - Analysis of slow SQL statements|https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=155413]
>
> Cheers,
> Abu
Hi,
I would bet not as many as you might think -  many questions here suffering form not GOING through
the analysis before they post it here. 
Meantime I think questions to SQL statement performance here will only be answered when the execution plan on the statement  is posted with it.
bye
yk

Similar Messages

  • Help with a very slow sql statement

    Hi this statement takes 10 seconds to run and is run a lot, can anyone help me speed it up.
    Each section in itself is quick but when i add the IN section it slows down, probably because there is 20291 rows in the view v_allitems.
    anyone know how i can speed up?
    select ITEMTYPE,
    ITEMID,
    NOTESID,
    NOTES,
    DUEDATE,
    OPENDATE,
    SUBJECT,
    TYPE,
    STATUS,
    OWNER,
    CREATEBY,
    CREATEDATE,
    ITEMCODE
    FROM v_allitems
    where
    ITEMCODE in ( 'ACT,'||4264) OR ITEMCODE IN
    (SELECT pcchildcode
    ||','
    || pcchild item
    FROM afpc
    CONNECT BY pcparent = prior pcchild
    AND pcparentcode = prior pcchildcode START
    WITH pcparent = 232
    AND pcparentcode = 'CAS'
    UNION ALL
    SELECT pcparentcode
    ||','
    || pcparent item
    FROM afpc
    CONNECT BY pcchild = prior pcparent
    AND pcchildcode = prior pcparentcode START
    WITH pcchild =4264
    AND pcchildcode = 'ACT'
    )

    Something to just try i guess (wild guessing here).
    WITH
       itemcodes AS
       SELECT
          DISTINCT ItemCode
       FROM
          SELECT 'ACT,' || 4264 AS ItemCode
          FROM DUAL
             UNION ALL    
             SELECT pcchildcode || ',' || pcchild item AS ItemCode
             FROM afpc
             CONNECT BY  pcparent       = prior pcchild
             AND         pcparentcode   = prior pcchildcode
             START WITH  pcparent       = 232
             AND         pcparentcode   = 'CAS'
                UNION ALL
             SELECT pcparentcode || ',' || pcparent item AS ItemCode
             FROM afpc
             CONNECT BY  pcchild     = prior pcparent
             AND         pcchildcode = prior pcparentcode
             START WITH  pcchild     = 4264
             AND         pcchildcode = 'ACT'
    SELECT
       v.ITEMTYPE,
       v.ITEMID,
       v.NOTESID,
       v.NOTES,
       v.DUEDATE,
       v.OPENDATE,
       v.SUBJECT,
       v.TYPE,
       v.STATUS,
       v.OWNER,
       v.CREATEBY,
       v.CREATEDATE,
       v.ITEMCODE
    FROM v_allitems v,  itemcodes i
    WHERE v.ItemCode  = i.ItemCode;Assuming (probably a good assumption) that's not good, how long does this query take to finish for you?
             SELECT pcchildcode || ',' || pcchild item AS ItemCode
             FROM afpc
             CONNECT BY  pcparent       = prior pcchild
             AND         pcparentcode   = prior pcchildcode
             START WITH  pcparent       = 232
             AND         pcparentcode   = 'CAS'
                UNION ALL
             SELECT pcparentcode || ',' || pcparent item AS ItemCode
             FROM afpc
             CONNECT BY  pcchild     = prior pcparent
             AND         pcchildcode = prior pcparentcode
             START WITH  pcchild     = 4264
             AND         pcchildcode = 'ACT'

  • Can't find SAP Tools for MS SQL Server

    Hello all,
    I need to do an dettach/attach procedure, and need this tool. As Note 683447 says, can't find the download tool for this tool.
    http://service.sap.com/msplatforms
    Could you give me a hint please?
    Thanks a lot.

    Hello Benjamin,
         following this note: 683447 - SAP Tools for MS SQL Server I could see these options:
    Thanks a lot and best regards

  • Regarding SAP notes for Budget-2007

    Hi all
    can anybody tell me the sequence the sap notes for budget 2007
    as our client using 4.6 C version of SAP
    helpful answer will get awarded
    Thanks in Advance

    hi Santosh
    thanks for reply really valauable answer u have given
    actually we r going to implicate the CIN for Budget -2007 and the current pacakge they r using is SAPKIPNG07
    could u tell me please how to upgrade the Patch level actually i didn't do any upgrade but i will have to do
    please give me the response of this
    thanks

  • How can I change the background of a running webpage on my own. Example Facebook I want to change its backround color from white to black just in my view not for all

    How can I change the background of a running webpage on my own. Example Facebook I want to change its background color from white to black just in my view, not for all. Cause I really hate some site with white background because as I read for an hour it aches my eyes but not on those with darker background color.

    You can use the NoSquint extension to set font sizes (text/page zoom) and text colors on web pages.
    *NoSquint: https://addons.mozilla.org/firefox/addon/nosquint/

  • Sap notes for 103 movement type and 105 movement types in sap

    Hi all,
    Please let me know if there are any sap notes for 103 movement type and 105 movement type in sap as soon as possible
    points will be awarded.
    thanking u in advance,
    srinivas.

    There are many SAP notes related to these movement types e.g 514609,750836,
    533833, 808029, 317823,etc.
    You can search them at http://service.sap.com
    Regards,
    Amit

  • What is the new sap note for Ptax slabs of FY 2011-12.

    Dear Experts,
                       we are currently using  ECC  6.0, release 604, patch level 0035 and support package SAPKE60435. professional tax slabs not updated in table V_T7INP4.
    what is the new sap note for Ptax slabs of FY 2011-12.

    Hi,
    The Profession Tax tables T7INP3 & T7INP4 are customizing tables in which the entries are to be modified. SAP provides the initial entries and, if there is any change in slab rates, then you would need to update these slabs manually.
    Please delimit the slab code in table T7INP3 and then create a new slab code entry from the date of delimition for the new rates in table T7INP4.
    Regards,
    Nishtha

  • SAP note for implementing FM CONVERSION_EXIT_MATN2_OUTPUT

    Hello Experts,
    I need to implement the FM CONVERSION_EXIT_MATN2_OUTPUT ( + Conversion routine MATN2 ) in our SAP system version 4.7.  Can anyone tell me if there are any specific SAP note for implementing it. 
    Note: Our SAP system dont have DI software component.  I want to implement the FM without going for DI.
    Awaiting reply,
    Thanks,
    Balaji
    Edited by: Balaji on Jan 19, 2009 11:59 AM
    Edited by: Balaji on Jan 19, 2009 1:02 PM

    Thanks.

  • SAP Note for XD99 : Data changed but Output screen show error message

    This is regarding the XD99.. Mass data update.
    I am looking for SAP Note to fix it. Here data is changed KNA1-Name1 but output shows the Error message..
    Is there any Sap Note for this.
    Edited by: Mukesh Mahajan on Dec 9, 2010 2:45 PM
    Edited by: Mukesh Mahajan on Dec 9, 2010 2:47 PM
    Moderator message: please have a look in the Service Marketplace yourself.
    Edited by: Thomas Zloch on Dec 9, 2010 2:58 PM

    Hi there, gwinslo. You have come to the right place.
    From what I have been reading from other posts on this forum, the issue may
    be caused by the clear history settings.
    Press the '''<Alt>''' or '''<F10>''' key to bring up the tool bar. Then '''Tools > Options > Privacy'''.
    The button next to '''History''', select '''Use Custom Settings'''.
    At the bottom of the page, turn on '''Clear History When Firefox Closes.'''
    At the far right, press the '''Settings''' button. Turn on ONLY '''Cache''' and
    '''Form And Search History''' leaving the others off.
    '''https://support.mozilla.org/questions/997866?esab=a&s=&r=1&as=s''' {web link}
    This is not a cure but will make it easier if Firefox locks up.

  • How could I set the proxy settings for just some URLs and not for all?

    Hello,
    I am using HttpURLConnection to establish a HTTP connection . The connection pass through a proxy, and it requires security.
    I know that I can set the proxy settings in the system properties, and this works perfect.
    But I don't want to set the proxy settings in the system properties, because this proxy settings will be for ALL the URLs, and I just want for a few URLs.
    How could I set the proxy settings for just some URLs and not for all?
    Thanks

    java.net.URL.openConnection(java.net.Proxy proxy)
    @since 1.5

  • SAP NOTE for Error in MB01

    Hi,
    I am searching for a SAP NOTE for an Error in MB01
    Error is :Check Table BIWE: Entry 0004 not found.
    Please let me know if anybody implemented note for this error.
    Iam searching in SAP Marketplace but didn't find the right one.
    <removed_by_moderator>
    Thanks,
    Rhea.
    Edited by: rhea on Jul 24, 2008 4:21 PM
    Edited by: Julius Bussche on Oct 7, 2008 5:09 PM

    Error No is M7001.
    This error is raised when the internal table BIWE and MSEG doesn't match ie. biwe-zeile NE mseg-zeile.
    I searched with those keywords (BIWE , MB01) but didn't find the right one.
    Regards,
    Rhea.

  • SAP Note for iw32

    Hi,
    Good day guys
    Ive the user exit for iw32 for creating the settelment rules. iam getting all values except cost center. Right now we are using Ecc 6.0.
    Plz let me know if any sap note for iw32 to get the cost center value.
    Regards

    Hi,
    I tried to find some oss message but there is only one SAP note 1250669 related to your problem. Please check this one.
    But looks that i has been published on 09.2008. So it might be in your system already.
    Regards,
    Lokesh.

  • SAP Notes for Revaluation

    Dear All,
    I have some issue related the revaluation. Do you ever know which SAP Notes for revaluation (FAGL_FC_VAL) which is explained that this revaluation cannot be assigned with each original cost object? Do you ever know which SAP Notes for revaluation Joint Venture (GJ91) which is explaned that this program only display the standard and we cannot add some new field in this screen? Please share if you know this notes.
    Thanks,
    Jones

    1. I have some issue related the revaluation. Do you ever know which SAP Notes for revaluation (FAGL_FC_VAL) which is explained that this revaluation cannot be assigned with each original cost object?
    https://service.sap.com/sap/support/notes/949971
    Please also check the related notes in the above note.

  • Parameter not accessible in SQL statement

    Hello
    I am assigning value to 2 parameters on the form (PARAMETER node)
    :parameter.p1:=5;
    :parameter.p2:='AAA';
    p1 is of number type and p2 is of char type.
    now i want to query as follows
    select count(*) from AA_table where id=:parameter.p1 and name=:parameter.p2;
    this statement return count=0, which is wrong. actual count is 1.
    why param values are not taken in SQL statement, as i display values of parameters using message(), it shows the values properly.....
    plzzzzzz..... help.......

    parameter datatype by default is char. So I doubt though you assign 5 to p1 it considers as a character.
    Try below
    select count(*) from AA_table where id=to_number(:parameter.p1) and name=:parameter.p2;
    or change the data type to number for p1
    Rajesh Alex

  • How can I open a cursor for dynamic sql statement

    Hi,
    I'm facing issues opening a cursor for dynamic sql statement : PLS-00455: cursor 'RESULT1' cannot be used in dynamic SQL OPEN statement.
    CREATE OR REPLACE FUNCTION DEMO
    (MN_I in VARCHAR)
    return AB_OWNER.ABC_Type.NonCurTyp is
    RESULT1 AB_OWNER.ABC_Type.NonCurTyp;
    sql_stmt VARCHAR2(4000);
    BEGIN
    sql_stmt := 'SELECT * FROM AB_OWNER.DUN WHERE JZ_I in ('||mn_i||') ORDER BY app.ACC_I';
    OPEN RESULT1 FOR sql_stmt;
    END IF;
    return RESULT1;
    END DEMO;
    What changes should I make in the code so that it doesn't fail? I can't change the definition of RESULT1 cursor though.

    Gangadhar Reddy wrote:
    I used SYS REFCURSOR and was able to implement successfully.How many times did you run this successful implementation that does not use bind variables?
    Because this is what will happen when it runs a lot.
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17766/e2100.htm#sthref1874
    http://forums.oracle.com/forums/search.jspa?q=%2BORA-04031%20%2Bbind&objID=c84&dateRange=all&rankBy=10001&start=30
    And you will have to regularly restart the server, or possibly slightly less invasive, flush the shared pool.
    Flushing Shared Pool regularly
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1516005546092
    >
    Ok, this is an easy one to diagnose.
    You are not using bind variables. This is terrible. Flushing the shared pool is a bad
    solution -- you are literally killing the performance on your box by not using them.
    If I was to write a book on how to build “non scalable applications in Oracle”, this
    would be the first and last chapter. This is a major cause of performance issues and a
    major inhibitor of scalability in Oracle. The way the Oracle shared pool (a very
    important shared memory data structure) operates is predicated on developers using bind
    variables. If you want to make Oracle run slowly, even grind to a total halt – just
    refuse to use them.
    >
    But, please feel free to go ahead with this successful implementation.
    I just hope anyone else who reads this doesn't make the same mistake.

Maybe you are looking for

  • Network connection problem

    This is the error message I get when I'm attempting to order the book I've created, "An error occured while uploading one of your files. Please check your network connection and click Retry to send your file." My network connection appears to be work

  • Vendor registration

    Hi experts After vendor replication from EBP to SUS an e-mail notification is sent to vendor with a URL, USER and Pass, when vendor goes to URL and do the registration and try to create an error occur, CALL FUNCTION NOR EXECUTABLE, INCORRECT PARAMETE

  • How to enable DHTML viewer in Java Infoview Portal

    Hi, I am using BOXi 3.1.  I have created a crystal report with cross tab, having the drilldown hyperlink enabled.  But when I export the report to Infoview I am not getting the drill down option.  When I searched the manual its mentioned that drill d

  • How to save configuration files.

    Hello. For a project at school I have to write have to write a configuration System. Our project should work on Unix and Windows so my question is. How i can determinate the path where to save our configuration file? under unix it shuld be saved as /

  • Can i charge my Macbook Pro using my wife's macbook adapter ?

    I'm not talking about charge and use at the same time. I simply want to plug my fully hibernated macbook pro into my wifes 65W power adapter (for her macbook) and charge my machine. Don't care if it takes longer. But will it work ? Or will it damage