<?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: HELP!Database query performace issue! :( in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-database-query-performace-issue/m-p/9315024#M1727645</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please follow the below points: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Internal table must be declared using TYPE STANDARD TABLE OF and work area must be used instead of HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;2) Always specify as many primary keys as possible in WHERE clause to make the Select efficient. Select should not be performed based on the non-key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) Using buffered table improves the performance considerably. But in some cases a statement cannot be used with the buffered tables. These statements are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;o Select DISTINCT&lt;BR /&gt;o ORDER BY/GROUP BY/HAVING clause&lt;BR /&gt;o Anywhere clause that contains a sub query&amp;nbsp; or IS NULL expression.&lt;BR /&gt;o JOINs&lt;BR /&gt;o A SELECT….FOR UPDATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the above statements are used on buffer table the buffer will be bypassed. If you want to explicitly bypass the buffer then use the addition BYPASSBUFFER in the SELECT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If any clarification, let me know. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Mar 2013 09:21:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2013-03-06T09:21:35Z</dc:date>
    <item>
      <title>HELP!Database query performace issue! :(</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-database-query-performace-issue/m-p/9315023#M1727644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are implementing a complicated employee search solution. And now there is a serious performance issue. For example, the following SQL statement takes about 300 seconds at the first query, and about 2.5 seconds after the first query using the same conditions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; SELECT PERNR INTO TABLE T_RESULT FROM PA0001 &lt;/P&gt;&lt;P&gt;&amp;nbsp; WHERE WERKS IN P1&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND ZZ_POSLV = '08'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;There are about 10,000,000 records in the tabe PA0001, about 150,000 employee fit the first condition, and 200 employee fit both conditions. &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;The table PA0001 is SAP buffer disabled, and the ZZ_POSLV field is an customer field without database index.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What's the difference between the first and the second query? How can we improve the performance of the first query?&lt;SPAN __jive_emoticon_name="cry" __jive_macro_name="emoticon" class="jive_macro jive_macro_emoticon jive_emote" src="https://community.sap.com/1245/images/emoticons/cry.gif"&gt;&lt;/SPAN&gt;&lt;SPAN __jive_emoticon_name="cry" __jive_macro_name="emoticon" class="jive_macro jive_macro_emoticon jive_emote" height="1" src="https://community.sap.com/1245/images/emoticons/cry.gif" width="1"&gt;&lt;/SPAN&gt;&lt;SPAN __jive_emoticon_name="cry" __jive_macro_name="emoticon" class="jive_macro jive_macro_emoticon jive_emote" height="1" src="https://community.sap.com/1245/images/emoticons/cry.gif" width="1"&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Guo Guo Qing&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2013 09:03:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-database-query-performace-issue/m-p/9315023#M1727644</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-03-06T09:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: HELP!Database query performace issue! :(</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-database-query-performace-issue/m-p/9315024#M1727645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please follow the below points: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Internal table must be declared using TYPE STANDARD TABLE OF and work area must be used instead of HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;2) Always specify as many primary keys as possible in WHERE clause to make the Select efficient. Select should not be performed based on the non-key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) Using buffered table improves the performance considerably. But in some cases a statement cannot be used with the buffered tables. These statements are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;o Select DISTINCT&lt;BR /&gt;o ORDER BY/GROUP BY/HAVING clause&lt;BR /&gt;o Anywhere clause that contains a sub query&amp;nbsp; or IS NULL expression.&lt;BR /&gt;o JOINs&lt;BR /&gt;o A SELECT….FOR UPDATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the above statements are used on buffer table the buffer will be bypassed. If you want to explicitly bypass the buffer then use the addition BYPASSBUFFER in the SELECT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If any clarification, let me know. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2013 09:21:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-database-query-performace-issue/m-p/9315024#M1727645</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-03-06T09:21:35Z</dc:date>
    </item>
  </channel>
</rss>

