<?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 on select query for all entries in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-on-select-query-for-all-entries/m-p/6977386#M1492188</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is nothing wrong with "FOR ALL ENTRIES" option, and we use it all the time. 1200 rows in t_ajot is not at all a big deal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You said you have created a secondary index, but is it created correctly? Can you share the index fields with us?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Other questions to poder:&lt;/P&gt;&lt;P&gt;1) Do you know for a fact that your index is being used?&lt;/P&gt;&lt;P&gt;2) How many rows are there in EBAN table?&lt;/P&gt;&lt;P&gt;3) How many entries would be there between matkl_low and matkl_high?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Jun 2010 15:50:48 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-06-01T15:50:48Z</dc:date>
    <item>
      <title>Performance optimization on select query for all entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-on-select-query-for-all-entries/m-p/6977382#M1492184</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 optimize the select query in my Program.&lt;/P&gt;&lt;P&gt;     The select query is taking lot of time to search the records for the given condition in the where clause&lt;/P&gt;&lt;P&gt;     and more interestingly there are no records fetched from the database as the where condition does not matches.  &lt;/P&gt;&lt;P&gt;     It is taking more than 30 min to search the record and the result is no record found.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     Below is my select query. I have also created the secondary Index for the same. &lt;/P&gt;&lt;P&gt;     In My opinion FOR ALL ENTRIES is taking lot of time. Because there are more than 1200 records in internal table t_ajot      &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      select banfn  bnfpo     bsart      txz01   matnr   Werks   lgort     matkl    reswk   menge     meins   flief      ekorg   &lt;/P&gt;&lt;P&gt;          INTO CORRESPONDING FIELDS OF TABLE t_req&lt;/P&gt;&lt;P&gt;          FROM eban&lt;/P&gt;&lt;P&gt;            FOR ALL ENTRIES IN t_ajot&lt;/P&gt;&lt;P&gt;          WHERE matkl &amp;gt;= t_ajot-matkl_low&lt;/P&gt;&lt;P&gt;            AND matkl &amp;lt;= t_ajot-matkl_high&lt;/P&gt;&lt;P&gt;            AND werks = t_ajot-werks&lt;/P&gt;&lt;P&gt;            AND loekz = ' '&lt;/P&gt;&lt;P&gt;            AND badat IN s_badat&lt;/P&gt;&lt;P&gt;            AND bsart = 'NB'.   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Please suggest.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jun 2010 12:35:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-on-select-query-for-all-entries/m-p/6977382#M1492184</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-01T12:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: Performance optimization on select query for all entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-on-select-query-for-all-entries/m-p/6977383#M1492185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what Index would you use to support this WHERE clause ???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
WHERE matkl &amp;gt;= t_ajot-matkl_low
AND matkl &amp;lt;= t_ajot-matkl_high
AND werks = t_ajot-werks
AND loekz = ' '
AND badat IN s_badat
AND bsart = 'NB'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jun 2010 13:19:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-on-select-query-for-all-entries/m-p/6977383#M1492185</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-01T13:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: Performance optimization on select query for all entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-on-select-query-for-all-entries/m-p/6977384#M1492186</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;that,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN t_ajot&lt;/P&gt;&lt;P&gt;WHERE matkl &amp;gt;= t_ajot-matkl_low&lt;/P&gt;&lt;P&gt;AND matkl &amp;lt;= t_ajot-matkl_high&lt;/P&gt;&lt;P&gt;AND werks = t_ajot-werks&lt;/P&gt;&lt;P&gt;AND loekz = ' '&lt;/P&gt;&lt;P&gt;AND badat IN s_badat&lt;/P&gt;&lt;P&gt;AND bsart = 'NB'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;looks strange.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How does your index look like?&lt;/P&gt;&lt;P&gt;What executoin plan do you get?&lt;/P&gt;&lt;P&gt;How do the statistics look like?&lt;/P&gt;&lt;P&gt;Whats the content of the variables t_ajot-... and s_badata?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hermann&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jun 2010 13:22:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-on-select-query-for-all-entries/m-p/6977384#M1492186</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2010-06-01T13:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Performance optimization on select query for all entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-on-select-query-for-all-entries/m-p/6977385#M1492187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have MATNR available?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because theres an index in eban that uses &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MATNR&lt;/P&gt;&lt;P&gt;WERK&lt;/P&gt;&lt;P&gt;LOEKZ &lt;/P&gt;&lt;P&gt;MATKL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you could include MATNR in this search, this index would activate and everything would work faster.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jun 2010 14:16:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-on-select-query-for-all-entries/m-p/6977385#M1492187</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-01T14:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: Performance optimization on select query for all entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-on-select-query-for-all-entries/m-p/6977386#M1492188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is nothing wrong with "FOR ALL ENTRIES" option, and we use it all the time. 1200 rows in t_ajot is not at all a big deal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You said you have created a secondary index, but is it created correctly? Can you share the index fields with us?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Other questions to poder:&lt;/P&gt;&lt;P&gt;1) Do you know for a fact that your index is being used?&lt;/P&gt;&lt;P&gt;2) How many rows are there in EBAN table?&lt;/P&gt;&lt;P&gt;3) How many entries would be there between matkl_low and matkl_high?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jun 2010 15:50:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-on-select-query-for-all-entries/m-p/6977386#M1492188</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-01T15:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: Performance optimization on select query for all entries</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-on-select-query-for-all-entries/m-p/6977387#M1492189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Moderator message - Please see &lt;SPAN __jive_macro_name="thread" id="1283414"&gt;&lt;/SPAN&gt; before posting - post locked

Rob&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jun 2010 16:16:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-optimization-on-select-query-for-all-entries/m-p/6977387#M1492189</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-01T16:16:13Z</dc:date>
    </item>
  </channel>
</rss>

