<?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 fine tuning the database query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/fine-tuning-the-database-query/m-p/1287172#M154273</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To analyse the load of a particular object. we do use 'performance analysis' in ABAP. But let us suppose we've come to know that more load is on the database. i.e. suppose 80% on database, 20% on Application server. what could be the possible steps that u wud perform on the query so that the load gets decreased. we don't have a chance to transform the load from database to application server (such as using internal tables and hence reducing the load). we should do something on the database side. so what can we do. any solution would be highly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance for the solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Mar 2006 11:23:20 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-03-17T11:23:20Z</dc:date>
    <item>
      <title>fine tuning the database query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fine-tuning-the-database-query/m-p/1287172#M154273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To analyse the load of a particular object. we do use 'performance analysis' in ABAP. But let us suppose we've come to know that more load is on the database. i.e. suppose 80% on database, 20% on Application server. what could be the possible steps that u wud perform on the query so that the load gets decreased. we don't have a chance to transform the load from database to application server (such as using internal tables and hence reducing the load). we should do something on the database side. so what can we do. any solution would be highly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance for the solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Mar 2006 11:23:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fine-tuning-the-database-query/m-p/1287172#M154273</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-17T11:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: fine tuning the database query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fine-tuning-the-database-query/m-p/1287173#M154274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One option  could be to use an INDEX on the table..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suresh Datti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Mar 2006 11:27:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fine-tuning-the-database-query/m-p/1287173#M154274</guid>
      <dc:creator>suresh_datti</dc:creator>
      <dc:date>2006-03-17T11:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: fine tuning the database query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fine-tuning-the-database-query/m-p/1287174#M154275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;   Yes, You can reduce the load on the Database by better use of internal tables.&lt;/P&gt;&lt;P&gt;Avoid Selects in loops.&lt;/P&gt;&lt;P&gt;Avoid Nested Selects and instead use For all entries stataments.&lt;/P&gt;&lt;P&gt;Avoid Select-endselect statements instead use, Select into table type of statements.&lt;/P&gt;&lt;P&gt;For more info,&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="421920"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;/message/1161039#1161039 &lt;B&gt;[original link is broken]&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="928880"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Mar 2006 11:27:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fine-tuning-the-database-query/m-p/1287174#M154275</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-17T11:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: fine tuning the database query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fine-tuning-the-database-query/m-p/1287175#M154276</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 should use ST05 and then Switch TRACE ON for SQL.&lt;/P&gt;&lt;P&gt;Then do your query again.&lt;/P&gt;&lt;P&gt;After you have run your query, you switch the trace OFF and then you display the trace.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When displaying the trace you can see which SQL queries that have been made and how long time they have taken (left most column).&lt;/P&gt;&lt;P&gt;If the time is RED that indicates a bad query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway. Doubleclick on the query to find out how the query is made.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And analyse the table(s) that are used and whether or not an INDEX is used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If no index is used you can ADD an index to the database table(s) in transaction SE10. Or directly in the database if you have that possibilty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ST05,&lt;/P&gt;&lt;P&gt;Trace on,&lt;/P&gt;&lt;P&gt;Run query,&lt;/P&gt;&lt;P&gt;Trace off,&lt;/P&gt;&lt;P&gt;Display trace,&lt;/P&gt;&lt;P&gt;Analyze trace.&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;BR Mattias&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Mar 2006 11:31:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fine-tuning-the-database-query/m-p/1287175#M154276</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-17T11:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: fine tuning the database query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fine-tuning-the-database-query/m-p/1287176#M154277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Few points:&lt;/P&gt;&lt;P&gt;1) Try to put less no. of select Queries in the prog.&lt;/P&gt;&lt;P&gt;2) Avoid repeating select query on to the same program.&lt;/P&gt;&lt;P&gt;3) Try to use select single instead of select *.&lt;/P&gt;&lt;P&gt;4) Use read inside a loop with binary search instead of using select inside a loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and lot more but at this amount of time following above steps will surely readuce the database loads.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;P&gt;Rewrd points, if found helpful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Mar 2006 11:32:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fine-tuning-the-database-query/m-p/1287176#M154277</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-17T11:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: fine tuning the database query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fine-tuning-the-database-query/m-p/1287177#M154278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The pdf below briefs how to improve and tune performance in ABAP...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sappoint.com/faq/faqsql.pdf" target="test_blank"&gt;http://www.sappoint.com/faq/faqsql.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also check...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/performance.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/performance.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Hope it helps...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regs,&lt;/P&gt;&lt;P&gt;jaga&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Mar 2006 11:36:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fine-tuning-the-database-query/m-p/1287177#M154278</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-17T11:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: fine tuning the database query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fine-tuning-the-database-query/m-p/1287178#M154279</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;Whatever values you need from a datatable,get it using a single select statement rather than using select inside loop...endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Put all the necessary data in internal table at a stretch from database and then use read or loop statements to process the data from internal table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Mar 2006 11:45:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fine-tuning-the-database-query/m-p/1287178#M154279</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2006-03-17T11:45:29Z</dc:date>
    </item>
  </channel>
</rss>

