<?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 Tunning in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2997781#M708134</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@Naresh,&lt;/P&gt;&lt;P&gt;I am getting tired of your answers, they are always the same (copied), and often wrong!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually there is not general answer for this question. In principle the three access types are no really comparable. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Join and view are similar, a view is join definition in the ddic. The execution is always the join. They are used if you need combined data from several db tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES are mainly used, if you needing corresponding data for record which you have already in an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sometimes joins are not processed in the optimal way, the optimzer starts with the wrong table or the wrong index for the first table, making the performance very bad. Then you should whether you can improve the join behavior. In some cases, &lt;/P&gt;&lt;P&gt;a split into a select and select FOR ALL ENTRIES can be the only option. But these cases are anyway compromises.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Subqueries fit only in special cases.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Nov 2007 17:40:58 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-11-13T17:40:58Z</dc:date>
    <item>
      <title>Performance Tunning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2997776#M708129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;which is better performance wise,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for all entries&lt;/P&gt;&lt;P&gt;views&lt;/P&gt;&lt;P&gt;or subquries&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2007 08:19:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2997776#M708129</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-13T08:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Tunning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2997777#M708130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES is the berret way than out of these 3 ways &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) For all Entreis used mainly to retrive the data from more than one table&lt;/P&gt;&lt;P&gt;instead of Using Nested Selected and Joins ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Performance wise , For all Entreis is better than the joins and also Nested Selected Statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward if usefull&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2007 09:08:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2997777#M708130</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-13T09:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Tunning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2997778#M708131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)The for all entries creates a where clause, where all the entries in the driver table are combined with OR. If the number of entries in the driver table is larger than rsdb/max_blocking_factor, several similar SQL statements are executed to limit the length of the WHERE clause. &lt;/P&gt;&lt;P&gt;	The plus &lt;/P&gt;&lt;P&gt;Large amount of data &lt;/P&gt;&lt;P&gt;Mixing processing and reading of data &lt;/P&gt;&lt;P&gt;Fast internal reprocessing of data &lt;/P&gt;&lt;P&gt;Fast &lt;/P&gt;&lt;P&gt;	The Minus &lt;/P&gt;&lt;P&gt;Difficult to program/understand &lt;/P&gt;&lt;P&gt;Memory could be critical (use FREE or PACKAGE size) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Points to be must considered FOR ALL ENTRIES &lt;/P&gt;&lt;P&gt;Check that data is present in the driver table&lt;/P&gt;&lt;P&gt;Sorting the driver table&amp;nbsp;&lt;/P&gt;&lt;P&gt;Removing duplicates from the driver table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider the following piece of extract&lt;/P&gt;&lt;P&gt; Loop at int_cntry.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Select single * from zfligh into int_fligh&lt;/P&gt;&lt;P&gt;&amp;nbsp;where cntry = int_cntry-cntry.&lt;/P&gt;&lt;P&gt;&amp;nbsp;Append int_fligh. &lt;/P&gt;&lt;P&gt;&amp;nbsp;Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above mentioned can be more optimized by using the following code.&lt;/P&gt;&lt;P&gt;Sort int_cntry by cntry.&lt;/P&gt;&lt;P&gt;Delete adjacent duplicates from int_cntry.&lt;/P&gt;&lt;P&gt;If NOT int_cntry[] is INITIAL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Select * from zfligh appending table int_fligh&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For all entries in int_cntry &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Where cntry = int_cntry-cntry.&lt;/P&gt;&lt;P&gt;Endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)Its better to use a views instead of nested Select statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)To read data from several logically connected tables use a join instead of nested Select statements. Joins are preferred only if all the primary key are available in WHERE clause for the tables that are joined. If the primary keys are not provided in join the Joining of tables itself takes time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3)Instead of using nested Select loops it is often better to use subqueries.    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;Point # 1&lt;/P&gt;&lt;BR /&gt;SELECT * FROM DD01L INTO DD01L_WA&lt;BR /&gt; WHERE DOMNAME LIKE 'CHAR%'&lt;BR /&gt; AND AS4LOCAL = 'A'.&lt;BR /&gt; SELECT SINGLE * FROM DD01T INTO DD01T_WA&lt;BR /&gt; WHERE DOMNAME = DD01L_WA-DOMNAME&lt;BR /&gt; AND AS4LOCAL = 'A'&lt;BR /&gt; AND AS4VERS = DD01L_WA-AS4VERS&lt;BR /&gt; AND DDLANGUAGE = SY-LANGU.&lt;BR /&gt;ENDSELECT.&lt;BR /&gt;&lt;BR /&gt;The above code can be more optimized by extracting all the data from view DD01V_WA &lt;BR /&gt;SELECT * FROM DD01V INTO DD01V_WA&lt;BR /&gt; WHERE DOMNAME LIKE 'CHAR%'&lt;BR /&gt; AND DDLANGUAGE = SY-LANGU.&lt;BR /&gt;ENDSELECT&lt;BR /&gt;&lt;BR /&gt;&lt;B&gt;&lt;P&gt;Point # 2&lt;/P&gt;&lt;/B&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM EKKO INTO EKKO_WA.&lt;/P&gt;&lt;P&gt;  SELECT * FROM EKAN INTO EKAN_WA&lt;/P&gt;&lt;P&gt;      WHERE EBELN = EKKO_WA-EBELN.&lt;/P&gt;&lt;P&gt;  ENDSELECT.&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;The above code can be much more optimized by the code written below.&lt;/P&gt;&lt;P&gt;SELECT P&lt;SUB&gt;F1 P&lt;/SUB&gt;F2 F&lt;SUB&gt;F3 F&lt;/SUB&gt;F4 INTO TABLE ITAB&lt;/P&gt;&lt;P&gt;    FROM EKKO AS P INNER JOIN EKAN AS F&lt;/P&gt;&lt;P&gt;      ON P&lt;SUB&gt;EBELN = F&lt;/SUB&gt;EBELN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;Point # 3&lt;/P&gt;&lt;BR /&gt;SELECT * FROM SPFLI&lt;BR /&gt; INTO TABLE T_SPFLI&lt;BR /&gt; WHERE CITYFROM = 'FRANKFURT'&lt;BR /&gt; AND CITYTO = 'NEW YORK'.&lt;BR /&gt;SELECT * FROM SFLIGHT AS F&lt;BR /&gt; INTO SFLIGHT_WA&lt;BR /&gt; FOR ALL ENTRIES IN T_SPFLI&lt;BR /&gt; WHERE SEATSOCC &amp;lt; F~SEATSMAX&lt;BR /&gt; AND CARRID = T_SPFLI-CARRID&lt;BR /&gt; AND CONNID = T_SPFLI-CONNID&lt;BR /&gt; AND FLDATE BETWEEN '19990101' AND '19990331'.&lt;BR /&gt;ENDSELECT.&lt;BR /&gt;The above mentioned code can be even more optimized by using subqueries instead of for all entries.&lt;BR /&gt;SELECT * FROM SFLIGHT AS F INTO SFLIGHT_WA&lt;BR /&gt; WHERE SEATSOCC &amp;lt; F~SEATSMAX&lt;BR /&gt; AND EXISTS ( SELECT * FROM SPFLI&lt;BR /&gt; WHERE CARRID = F~CARRID&lt;BR /&gt; AND CONNID = F~CONNID&lt;BR /&gt; AND CITYFROM = 'FRANKFURT'&lt;BR /&gt; AND CITYTO = 'NEW YORK' )&lt;BR /&gt; AND FLDATE BETWEEN '19990101' AND '19990331'.&lt;BR /&gt;ENDSELECT.&lt;BR /&gt;&lt;BR /&gt;&lt;B&gt;&lt;P&gt;Reward if usefull&lt;/P&gt;&lt;/B&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2007 09:15:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2997778#M708131</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-13T09:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Tunning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2997779#M708132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sirisha, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES is not always faster then joins or subqueries. The correct answer is: It depends. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From an performance perspective views are not relevant. In relational systems views are designed to reduce the amount of data shown to the user instead of increasing the performance of an application. All queries formulated with views could also be formulated without the view. But subqueries and joins (may be you mean joins where you've written view) could improve performance dramatically. In SAP R3 in earlier releases, views were the only possibility to formulate joins.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which statement is the best from a performance perspective depends on the type of statement. The difference between the different statements is where the load to the database server is higher. The goal should be to reduce the load to the database server, because it will improve scalability of applicationw. But if your application sends millions of rows to the database server to query lots of rows by primary key, it could be better to use a join or subquery instead of FOR ALL ENTRIES. If the SQL statement includes complex expressions, then it is probably a candidate for FOR ALL ENTRIES because the database load will be much higher executing those expressions instead of distribute them to the application servers (if you have not only a central instance together with the database). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;Ralph&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2007 09:35:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2997779#M708132</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-13T09:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Tunning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2997780#M708133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Usually, JOINs are a bit quicker:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;a href="/people/rob.burbank/blog/2007/03/19/joins-vs-for-all-entries--which-performs-better"&amp;gt;JOINS vs. FOR ALL ENTRIES - Which Performs Better?&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2007 14:43:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2997780#M708133</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-13T14:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Tunning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2997781#M708134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@Naresh,&lt;/P&gt;&lt;P&gt;I am getting tired of your answers, they are always the same (copied), and often wrong!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually there is not general answer for this question. In principle the three access types are no really comparable. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Join and view are similar, a view is join definition in the ddic. The execution is always the join. They are used if you need combined data from several db tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES are mainly used, if you needing corresponding data for record which you have already in an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sometimes joins are not processed in the optimal way, the optimzer starts with the wrong table or the wrong index for the first table, making the performance very bad. Then you should whether you can improve the join behavior. In some cases, &lt;/P&gt;&lt;P&gt;a split into a select and select FOR ALL ENTRIES can be the only option. But these cases are anyway compromises.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Subqueries fit only in special cases.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2007 17:40:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2997781#M708134</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-13T17:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Tunning</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2997782#M708135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;TABLES: bsik, bsak, bseg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS: s_bukrs FOR bsik-bukrs OBLIGATORY,&lt;/P&gt;&lt;P&gt;s_lifnr FOR bsik-lifnr OBLIGATORY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF bsik_int OCCURS 0.&lt;/P&gt;&lt;P&gt;INCLUDE STRUCTURE bsik.&lt;/P&gt;&lt;P&gt;DATA: END OF bsik_int.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF bseg_int OCCURS 0.&lt;/P&gt;&lt;P&gt;INCLUDE STRUCTURE bseg.&lt;/P&gt;&lt;P&gt;DATA: END OF bseg_int.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM bsik&lt;/P&gt;&lt;P&gt;INTO TABLE bsik_int&lt;/P&gt;&lt;P&gt;WHERE bukrs IN s_bukrs&lt;/P&gt;&lt;P&gt;AND lifnr IN s_lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM bsak&lt;/P&gt;&lt;P&gt;APPENDING TABLE bsik_int&lt;/P&gt;&lt;P&gt;WHERE bukrs IN s_bukrs&lt;/P&gt;&lt;P&gt;AND lifnr IN s_lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM bseg&lt;/P&gt;&lt;P&gt;INTO TABLE bseg_int&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN bsik_int&lt;/P&gt;&lt;P&gt;WHERE bukrs = bsik_int-bukrs&lt;/P&gt;&lt;P&gt;AND belnr = bsik_int-belnr&lt;/P&gt;&lt;P&gt;AND gjahr = bsik_int-gjahr&lt;/P&gt;&lt;P&gt;AND ebeln = space. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from &lt;/P&gt;&lt;P&gt;mukesh goyal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2007 10:49:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tunning/m-p/2997782#M708135</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-15T10:49:17Z</dc:date>
    </item>
  </channel>
</rss>

