<?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 optimization in SQL in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-in-sql/m-p/3354251#M804669</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 select query can be modified little by changing &lt;STRONG&gt;INTO CORRESPONDING FIELDS&lt;/STRONG&gt; with &lt;STRONG&gt;INTO TABLE&lt;/STRONG&gt; as there are huge no.of records to reduce lil bit of time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Can check that there are actually entries in the Select-Options for Primary or Secondary index key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Can use less no.of Select-Options in the selection screen if possible or else make sure tht Select-Options have values(use small range or if possible single values) before executing the report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. Check the performance with ST05(SQL Trace) or SE30.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Srilatha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Jan 2008 16:21:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-23T16:21:04Z</dc:date>
    <item>
      <title>performance optimization in SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-in-sql/m-p/3354242#M804660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a SQL that retrieves data from BSAK with 13 million records and it is taking very long time. I have the following SQL and I don't see how else I can optimize it! If anyone has any suggestions, please let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select b&lt;SUB&gt;bukrs b&lt;/SUB&gt;zuonr b&lt;SUB&gt;gjahr b&lt;/SUB&gt;monat b&lt;SUB&gt;belnr b&lt;/SUB&gt;buzei&lt;/P&gt;&lt;P&gt;           b&lt;SUB&gt;lifnr b&lt;/SUB&gt;blart b&lt;SUB&gt;bldat b&lt;/SUB&gt;xblnr b~budat&lt;/P&gt;&lt;P&gt;           b&lt;SUB&gt;shkzg b&lt;/SUB&gt;wrbtr b&lt;SUB&gt;sknto b&lt;/SUB&gt;augbl&lt;/P&gt;&lt;P&gt;           b~augdt&lt;/P&gt;&lt;P&gt;          into corresponding fields of table i_bsak&lt;/P&gt;&lt;P&gt;          from bsak as b&lt;/P&gt;&lt;P&gt;                 where b~bukrs in s_bukrs&lt;/P&gt;&lt;P&gt;                    and b~lifnr in s_lifnr&lt;/P&gt;&lt;P&gt;                    and b~umsks in s_umsks&lt;/P&gt;&lt;P&gt;                    and b~umskz in s_umskz&lt;/P&gt;&lt;P&gt;                    and b~augdt in s_augdt&lt;/P&gt;&lt;P&gt;                    and b~augbl in s_augbl&lt;/P&gt;&lt;P&gt;                    and b~zuonr in s_zuonr&lt;/P&gt;&lt;P&gt;                    and b~gjahr in s_gjahr&lt;/P&gt;&lt;P&gt;                    and b~belnr in s_belnr&lt;/P&gt;&lt;P&gt;                    and b~buzei in s_buzei&lt;/P&gt;&lt;P&gt;                    and b~blart in s_blart&lt;/P&gt;&lt;P&gt;                    and b~monat in s_monat&lt;/P&gt;&lt;P&gt;                    and b~bldat in s_bldat&lt;/P&gt;&lt;P&gt;                    and b~xblnr in s_xblnr&lt;/P&gt;&lt;P&gt;                    and b~cpudt in s_cpudt                     &lt;/P&gt;&lt;P&gt;                    and b~budat in s_budat&lt;/P&gt;&lt;P&gt;                    and b~wrbtr in s_wrbtr&lt;/P&gt;&lt;P&gt;                    and b~sknto in s_sknto.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Mithun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 15:12:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-in-sql/m-p/3354242#M804660</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-23T15:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: performance optimization in SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-in-sql/m-p/3354243#M804661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Mithun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;some suggestions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"into corresponding fields of table i_bsak"&lt;/P&gt;&lt;P&gt;==&amp;gt; replace with INTO TABLE i_BSAK (and make sure that it has exactly the same structure like the fields you select)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;than you have  to consider if you really need all of these fields in the WHERE:&lt;/P&gt;&lt;P&gt;and b~gjahr in s_gjahr&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;and b~monat in s_monat&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;and b~budat in s_budat&lt;/P&gt;&lt;P&gt;==&amp;gt; either gajhr and monat OR budat only (gjahr and monat will come from budat, so there is no need to check all three)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and b~buzei in s_buzei&lt;/P&gt;&lt;P&gt;==&amp;gt; this one you definetly don't need&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and so on...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;ec&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 15:20:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-in-sql/m-p/3354243#M804661</guid>
      <dc:creator>JozsefSzikszai</dc:creator>
      <dc:date>2008-01-23T15:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: performance optimization in SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-in-sql/m-p/3354244#M804662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  You are only using one table BSAK and there is no join involved. So you may use select &amp;lt;field1&amp;gt; &amp;lt;field2&amp;gt; ... into table i_bsak where .... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, do not use 'corresponding' and instead define internal table i_bsak with the fields you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Venu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 15:24:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-in-sql/m-p/3354244#M804662</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-23T15:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: performance optimization in SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-in-sql/m-p/3354245#M804663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What would really help is look for suitable secondary indices and see if you can use these fields in the where condition with value = instad of value in. Simgle value so to speak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 15:26:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-in-sql/m-p/3354245#M804663</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-23T15:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: performance optimization in SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-in-sql/m-p/3354246#M804664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just make sure there are entries in both s_bukrs and s_lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 15:27:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-in-sql/m-p/3354246#M804664</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-23T15:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: performance optimization in SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-in-sql/m-p/3354247#M804665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;you'd better make sure that S_BUKRS and S_LIFNR have very narrow selection criteria. If possible, S_BUKRS should have only ONE company code.&lt;/P&gt;&lt;P&gt;Otherwise I see no way to quickly select from 13 million BSAK records.&lt;/P&gt;&lt;P&gt;Greetings&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: did not see Rob's post before I posted mine &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 15:31:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-in-sql/m-p/3354247#M804665</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-01-23T15:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: performance optimization in SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-in-sql/m-p/3354248#M804666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i would suggest you to check with st22, and se30 to more about the points that needs to change in your select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check these points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1-Check wheather you r accessing data using key fields or not&lt;/P&gt;&lt;P&gt;2-Check whether you can use any alternative table other than the table you have used .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 15:39:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-in-sql/m-p/3354248#M804666</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-23T15:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: performance optimization in SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-in-sql/m-p/3354249#M804667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mrutyunjaya Tripathy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm curious why you are writing "good" in the second line of your posts.&lt;/P&gt;&lt;P&gt;Would you tell me? No offense intended.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 15:48:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-in-sql/m-p/3354249#M804667</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-01-23T15:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: performance optimization in SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-in-sql/m-p/3354250#M804668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;probably it is some traditional greeting, however I am curious as well &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 16:13:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-in-sql/m-p/3354250#M804668</guid>
      <dc:creator>JozsefSzikszai</dc:creator>
      <dc:date>2008-01-23T16:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: performance optimization in SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-in-sql/m-p/3354251#M804669</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 select query can be modified little by changing &lt;STRONG&gt;INTO CORRESPONDING FIELDS&lt;/STRONG&gt; with &lt;STRONG&gt;INTO TABLE&lt;/STRONG&gt; as there are huge no.of records to reduce lil bit of time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Can check that there are actually entries in the Select-Options for Primary or Secondary index key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Can use less no.of Select-Options in the selection screen if possible or else make sure tht Select-Options have values(use small range or if possible single values) before executing the report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. Check the performance with ST05(SQL Trace) or SE30.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Srilatha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 16:21:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-in-sql/m-p/3354251#M804669</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-23T16:21:04Z</dc:date>
    </item>
  </channel>
</rss>

