<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Performance turning questions in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-turning-questions/m-p/7908136#M1597476</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Yuri,&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Originally i used the for all entries in instead of the range table. But the internal table lt_inv_data has about 15,000 records, and the performance for this SQL is very bad. &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; So i replaced the for all entries in with range table. and limit the length for the range table is 8000 to avoided a dump.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Unfortunately, the performance even worse, because the abap time increased and the database time just a little improvement. &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; I don't know why......&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; BTW, the sorted table is very useful, thanks again.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Regards,&lt;/P&gt;&lt;P&gt;&amp;gt; Ivy&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ivy, the range table will not provide you any significant improvement comparing with "for all entries".&lt;/P&gt;&lt;P&gt;15.000 documents is quite significant number. When selecting with a good index (I guess the right one is used in your case), you should expect around several milliseconds per row. So one select with 15.000 in "for all entries" table should probably take around 75 seconds (roughly estimated).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 May 2011 15:41:33 GMT</pubDate>
    <dc:creator>yuri_ziryukin</dc:creator>
    <dc:date>2011-05-24T15:41:33Z</dc:date>
    <item>
      <title>Performance turning questions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-turning-questions/m-p/7908131#M1597471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to improve my database and abap time. The following code has the performance issue, so who can tell me how to improve my code performance? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;removed by moderator&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table: VBRK has 10 index: &lt;/P&gt;&lt;P&gt;0:       MANDT, VBELN&lt;/P&gt;&lt;P&gt;LOC:  MANDT, LCNUM&lt;/P&gt;&lt;P&gt;N:      MANDT, ISHFALNR, ISHEINRI&lt;/P&gt;&lt;P&gt;N1:    MANDT, ISHSAMNR&lt;/P&gt;&lt;P&gt;Z01:   MANDT, XBLNR, KUNRG&lt;/P&gt;&lt;P&gt;Z02:   MANDT, ERDAT&lt;/P&gt;&lt;P&gt;Z03:   MANDT, RFBSK, FKTYP&lt;/P&gt;&lt;P&gt;Z04:   MANDT, KUNAG, FKDAT&lt;/P&gt;&lt;P&gt;Z05:   MANDT, VGBEL&lt;/P&gt;&lt;P&gt;Z07:   MANDT, FKDAT_RL, ZTERM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table: VBRP has 6 index:&lt;/P&gt;&lt;P&gt;0:      MANDT, VBELN, POSNR&lt;/P&gt;&lt;P&gt;3:      MANDT, ISHORGID, ERDAT&lt;/P&gt;&lt;P&gt;OI0:   MANDT,OICONTNR, AUBEL, VGBEL, VGPOS&lt;/P&gt;&lt;P&gt;z01:   MANDT, WERKS, FKIMG&lt;/P&gt;&lt;P&gt;z02:   MANDT, AUBEL, VGBEL&lt;/P&gt;&lt;P&gt;z03:   MANDT, VKBUR, ERDAT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot .&lt;/P&gt;&lt;P&gt;Ivy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Moderator message: please post only relevant code parts, observe the maximum of 5000 characters per post to preserve formatting, also please choose more meaningful titles when posting.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Thomas Zloch on May 24, 2011 4:00 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2011 08:19:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-turning-questions/m-p/7908131#M1597471</guid>
      <dc:creator>former_member295022</dc:creator>
      <dc:date>2011-05-24T08:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Performance turning questions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-turning-questions/m-p/7908132#M1597472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ivy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know if many entries with the same billing_doc appear in your table lt_inv_data.&lt;/P&gt;&lt;P&gt;If yes, please make sure that you don't add duplicate entries to the range table.&lt;/P&gt;&lt;P&gt;Alternatively you may move your selects out of the loop and make "for all entries". This will spare you your trick with the counter to avoid a dump due to the large range table (anyway, make sure there are no duplicate billing_docs in your internal table).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next typical mistake:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Delete the records which deleted flag is not null&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  DELETE lt_vbrk WHERE fksto IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Always filter out records as soon as possible. Include this condition into your selects above instead of deleting in ABAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Caculate the freight&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    LOOP AT lt_freight INTO ls_freight&lt;/P&gt;&lt;P&gt;                       WHERE vbeln = &amp;lt;fs_vbrk&amp;gt;-vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Define lt_freight as a sorted table with the non-unique key VBELN.&lt;/P&gt;&lt;P&gt;Removethe statement   SORT lt_freight  BY vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now your loop will benefit from the sorted table type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the selects:&lt;/P&gt;&lt;P&gt;Definition of a new index on VBRP with fields MANDT, VBELN, KZWI4 will help further, but this should be a last thing to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;  Yuri&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Yuri Ziryukin on May 24, 2011 10:55 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2011 08:55:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-turning-questions/m-p/7908132#M1597472</guid>
      <dc:creator>yuri_ziryukin</dc:creator>
      <dc:date>2011-05-24T08:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: Performance turning questions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-turning-questions/m-p/7908133#M1597473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yuri,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Originally i used the for all entries in instead of the range table. But the internal table lt_inv_data has about 15,000 records, and the performance for this SQL is very bad. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i replaced the for all entries in with range table. and limit the length for the range table is 8000 to avoided a dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, the performance even worse, because the abap time increased and the database time just a little improvement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know why......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW, the sorted table is very useful, thanks again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ivy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2011 10:39:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-turning-questions/m-p/7908133#M1597473</guid>
      <dc:creator>former_member295022</dc:creator>
      <dc:date>2011-05-24T10:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: Performance turning questions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-turning-questions/m-p/7908134#M1597474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the selects:&lt;/P&gt;&lt;P&gt;Definition of a new index on VBRP with fields MANDT, VBELN, KZWI4 will help further, but this should be a last thing to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's not a good choice for an index.  It would just be a waste of space.  Your other suggestions sound on track but it's hard to tell - the original post is illegible ;-).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@Ivy: On the FOR ALL ENTRIES, did you trace/analyze WHY the performance is bad?  There could be several reasons, not related to the use of the FOR ALL ENTRIES...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2011 13:32:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-turning-questions/m-p/7908134#M1597474</guid>
      <dc:creator>brad_bohn</dc:creator>
      <dc:date>2011-05-24T13:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: Performance turning questions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-turning-questions/m-p/7908135#M1597475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; That's not a good choice for an index.  It would just be a waste of space.  Your other suggestions sound on track but it's hard to tell - the original post is illegible ;-).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Brad, this index allows to spare the table access, only index access will be necessary. It will be improving select performance for VBRP access probably by factors. I agree that's not the best thing to do, but if the performance of the report is really very critical, I would still consider that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2011 15:35:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-turning-questions/m-p/7908135#M1597475</guid>
      <dc:creator>yuri_ziryukin</dc:creator>
      <dc:date>2011-05-24T15:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: Performance turning questions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-turning-questions/m-p/7908136#M1597476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Yuri,&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Originally i used the for all entries in instead of the range table. But the internal table lt_inv_data has about 15,000 records, and the performance for this SQL is very bad. &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; So i replaced the for all entries in with range table. and limit the length for the range table is 8000 to avoided a dump.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Unfortunately, the performance even worse, because the abap time increased and the database time just a little improvement. &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; I don't know why......&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; BTW, the sorted table is very useful, thanks again.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Regards,&lt;/P&gt;&lt;P&gt;&amp;gt; Ivy&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ivy, the range table will not provide you any significant improvement comparing with "for all entries".&lt;/P&gt;&lt;P&gt;15.000 documents is quite significant number. When selecting with a good index (I guess the right one is used in your case), you should expect around several milliseconds per row. So one select with 15.000 in "for all entries" table should probably take around 75 seconds (roughly estimated).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2011 15:41:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-turning-questions/m-p/7908136#M1597476</guid>
      <dc:creator>yuri_ziryukin</dc:creator>
      <dc:date>2011-05-24T15:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: Performance turning questions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-turning-questions/m-p/7908137#M1597477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I understand your point but I don't think 'index access only' implemented for a single program is a good reason for creating another secondary index, especially with the leading fields of the primary key.  I could not read the blob of the original post and code before coffee this morning, but it doesn't sound like that was a big issue with the code.  Your suggestions sounded good though &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2011 17:39:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-turning-questions/m-p/7908137#M1597477</guid>
      <dc:creator>brad_bohn</dc:creator>
      <dc:date>2011-05-24T17:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: Performance turning questions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-turning-questions/m-p/7908138#M1597478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think 'index access only' implemented for a single program is a good reason for creating another secondary index, especially with the leading fields of the primary key.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Sure, that's why I have specifically said it's a last thing to do &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2011 07:30:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-turning-questions/m-p/7908138#M1597478</guid>
      <dc:creator>yuri_ziryukin</dc:creator>
      <dc:date>2011-05-25T07:30:01Z</dc:date>
    </item>
  </channel>
</rss>

