<?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 issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4501228#M1065045</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try to use the primary key in the select ,or if not create the Index with fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bharani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Sep 2008 11:41:52 GMT</pubDate>
    <dc:creator>BH2408</dc:creator>
    <dc:date>2008-09-26T11:41:52Z</dc:date>
    <item>
      <title>performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4501226#M1065043</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;I am working on a performance issue.when i checked in ST04 transaction for one of the select statement,it is showing estimated costs as 487.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I checked in the program that particular select statement,i found that the index is not created on the fields used in the where condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;given below is the select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT&lt;/P&gt;&lt;P&gt;    matnr&lt;/P&gt;&lt;P&gt;    charg&lt;/P&gt;&lt;P&gt;    sobkz&lt;/P&gt;&lt;P&gt;    kunnr&lt;/P&gt;&lt;P&gt;    lfgja&lt;/P&gt;&lt;P&gt;    lfmon&lt;/P&gt;&lt;P&gt;    kulab&lt;/P&gt;&lt;P&gt;  FROM msku&lt;/P&gt;&lt;P&gt;  INTO TABLE t_msku&lt;/P&gt;&lt;P&gt;  FOR ALL ENTRIES IN t_msku_key&lt;/P&gt;&lt;P&gt;  WHERE&lt;/P&gt;&lt;P&gt;    matnr IN s_matnr&lt;/P&gt;&lt;P&gt;    AND werks IN r_werks&lt;/P&gt;&lt;P&gt;    AND sobkz IN r_sobkz&lt;/P&gt;&lt;P&gt;    AND kunnr = t_msku_key-kunnr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have checked in DB05 transaction whether it is feasible to create an index on those fields(werks,sobkz,kunnr).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found the values for werks as 42.126 between 1-10&lt;/P&gt;&lt;P&gt;                                       and 8.923 between 11-100&lt;/P&gt;&lt;P&gt;                                             616   between 101-1.000&lt;/P&gt;&lt;P&gt;                              sobkz    51.252 between 1-10&lt;/P&gt;&lt;P&gt;                                          8.753 between 11-100&lt;/P&gt;&lt;P&gt;                                         586  between 101-1.000&lt;/P&gt;&lt;P&gt;                               kunnr 470.434.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is it feasible to create an index on these fields?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Sep 2008 10:20:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4501226#M1065043</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-26T10:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4501227#M1065044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The index needs just MANDT and KUNNR as key fields, since you have an EQ-condition for KUNNR, plus the field is highly selective.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Sep 2008 11:13:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4501227#M1065044</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-09-26T11:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4501228#M1065045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try to use the primary key in the select ,or if not create the Index with fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bharani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Sep 2008 11:41:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4501228#M1065045</guid>
      <dc:creator>BH2408</dc:creator>
      <dc:date>2008-09-26T11:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4501229#M1065046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hmmm, Thomas here I would not support your answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know the table and have no system where is really filled, but the table name is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Special Stocks with Customer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are probably only records for a few customers, KUNNR must not be highly selective in every table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The key fields are&lt;/P&gt;&lt;P&gt;MANDT&lt;/P&gt;&lt;P&gt;MATNR&lt;/P&gt;&lt;P&gt;WERKS&lt;/P&gt;&lt;P&gt;CHARG&lt;/P&gt;&lt;P&gt;SOBKZ&lt;/P&gt;&lt;P&gt;KUNNR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so charg is missing. Maybe CHARG could be added to the select.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But most important your select is from the coding, because of the in-clauses:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHERE&lt;/P&gt;&lt;P&gt;matnr IN s_matnr&lt;/P&gt;&lt;P&gt;AND werks IN r_werks&lt;/P&gt;&lt;P&gt;AND sobkz IN r_sobkz&lt;/P&gt;&lt;P&gt;AND kunnr = t_msku_key-kunnr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But you need to check the statement going to the database, maybe the IN-clauses&lt;/P&gt;&lt;P&gt;are not all used !!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Better use ST05, and check time, details and explain, instead of costs in the cursor cache!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Sep 2008 14:12:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4501229#M1065046</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-26T14:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4501230#M1065047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Siegfried,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I based my recommendation on the DB05 values provided:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; kunnr 470.434.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sounds like many distinct values for KUNNR and thus a high selectivity. Question is, whether this figure applies to KUNNR &lt;EM&gt;only&lt;/EM&gt; or to the full primary key down to field KUNNR. If it is the former, I think my recommendation might work OK. Only the original poster can clarify. What is your take on this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Sep 2008 20:17:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4501230#M1065047</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-09-26T20:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4501231#M1065048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should the index be created on fields having more number of distinct values?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now can i create an index on matnr,werks,sobkz and kunnr?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2008 09:33:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4501231#M1065048</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-29T09:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4501232#M1065049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; Should the index be created on fields having more number of distinct values?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yes, imho.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do me a favor and run DB05 again with option "analysis for specified fields" and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) only for kunnr&lt;/P&gt;&lt;P&gt;2) for matnr,werks,sobkz and kunnr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please post both results here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2008 09:39:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4501232#M1065049</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-09-29T09:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4501233#M1065050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;Should the index be created on fields having more number of distinct values?&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Yes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;Now can i create an index on matnr,werks,sobkz and kunnr?&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Why? If s_matnr is filled, you won't need an index at all ! And that index will not work too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would create the index in kunnr that Thomas proposed if you don't fill s_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Valter Oliveira.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2008 09:40:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4501233#M1065050</guid>
      <dc:creator>valter_oliveira</dc:creator>
      <dc:date>2008-09-29T09:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4501234#M1065051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I checked in DB05 with only kunnr field,it is showing following values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     distinct values 1-10       11-100    101-1.000      1.001-10.000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kunnr   7.745        2.340      3.773       1.631           1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i checked for matnr,werks,sobkz and kunnr fields,it is showing following values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     distinct values 1-10    11-100  101-1.000   1.001-10.000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matnr  10.426       8.082   1.726      515           103&lt;/P&gt;&lt;P&gt;werks   51.665      42.126  8.923      616&lt;/P&gt;&lt;P&gt;sobkz   51.665      42.126  8.923      616&lt;/P&gt;&lt;P&gt;kunnr    460.505    460.264  240       1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2008 10:01:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4501234#M1065051</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-29T10:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4501235#M1065052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think Siegfried's main concern was that KUNNR might not be very selective, but&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; kunnr   7.745     &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sounds pretty good, so I would go for the MANDT / KUNNR index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2008 10:25:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4501235#M1065052</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-09-29T10:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4501236#M1065053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; Question is, whether this figure applies to KUNNR only or to the full primary key down to field KUNNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have not used the DB05 before, it is quite interesting, gives you even an idea of the distribution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The displayed information is distinct values of all the fields cumulative, i.e. quite different than the display in the explain. It should not confused.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MANDT KUNNR is probably not standard index, because it can be selective like here but it must not be selective.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2008 13:31:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/4501236#M1065053</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-29T13:31:36Z</dc:date>
    </item>
  </channel>
</rss>

