<?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 performance in select statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/6370711#M1401737</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;i am trying to fetch data from coep table by using for all entries.it is taking a lot of time.when i gave the same values in the se16 of that table it took time but not the same time as in the program,below is my select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; if not obj_t[] is initial.&lt;/P&gt;&lt;P&gt;        select kokrs&lt;/P&gt;&lt;P&gt;               belnr&lt;/P&gt;&lt;P&gt;               buzei&lt;/P&gt;&lt;P&gt;               perio&lt;/P&gt;&lt;P&gt;               wkgbtr&lt;/P&gt;&lt;P&gt;               objnr&lt;/P&gt;&lt;P&gt;               gjahr&lt;/P&gt;&lt;P&gt;               kstar&lt;/P&gt;&lt;P&gt;               bukrs&lt;/P&gt;&lt;P&gt;               into table it_assign_t&lt;/P&gt;&lt;P&gt;               from coep&lt;/P&gt;&lt;P&gt;               for all entries in obj_t&lt;/P&gt;&lt;P&gt;               where perio in s_period&lt;/P&gt;&lt;P&gt;               and objnr = obj_t-objnr.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;i had created a secondary index for this two fields in the same order in the coep table even than it is taking huge time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Dec 2009 00:46:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-12-11T00:46:15Z</dc:date>
    <item>
      <title>performance in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/6370711#M1401737</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;i am trying to fetch data from coep table by using for all entries.it is taking a lot of time.when i gave the same values in the se16 of that table it took time but not the same time as in the program,below is my select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; if not obj_t[] is initial.&lt;/P&gt;&lt;P&gt;        select kokrs&lt;/P&gt;&lt;P&gt;               belnr&lt;/P&gt;&lt;P&gt;               buzei&lt;/P&gt;&lt;P&gt;               perio&lt;/P&gt;&lt;P&gt;               wkgbtr&lt;/P&gt;&lt;P&gt;               objnr&lt;/P&gt;&lt;P&gt;               gjahr&lt;/P&gt;&lt;P&gt;               kstar&lt;/P&gt;&lt;P&gt;               bukrs&lt;/P&gt;&lt;P&gt;               into table it_assign_t&lt;/P&gt;&lt;P&gt;               from coep&lt;/P&gt;&lt;P&gt;               for all entries in obj_t&lt;/P&gt;&lt;P&gt;               where perio in s_period&lt;/P&gt;&lt;P&gt;               and objnr = obj_t-objnr.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;i had created a secondary index for this two fields in the same order in the coep table even than it is taking huge time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2009 00:46:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/6370711#M1401737</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-11T00:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: performance in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/6370712#M1401738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;Run SQL trace and check whether select query is picking index or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nag&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2009 02:50:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/6370712#M1401738</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-11T02:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: performance in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/6370713#M1401739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   In first scenario,as you are not using key fields,so it will take time.Your approach of creating index is right in order to solve the problem.But I guess you have create index with the fields in order : perio ,objnr.&lt;/P&gt;&lt;P&gt;  This 'perio' field has range from 1 to 999.So although index is helpful,still a lot of records have to be searched for your query.I would advice you to delete the current index and create a new one with the fields in order :&lt;/P&gt;&lt;P&gt;mandt&lt;/P&gt;&lt;P&gt;objnr&lt;/P&gt;&lt;P&gt;perio&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As there will be very few records with objnr same as provided by ur select statement.Performance will improve&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2009 06:16:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/6370713#M1401739</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-11T06:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: performance in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/6370714#M1401740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;thanks for the reply,sorry i pasted the code before the change,infact i had given objnr than perio later in the where condition.even than the performance is still worst.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2009 06:28:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/6370714#M1401740</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-11T06:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: performance in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/6370715#M1401741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your secondary index is entirely unnecessary. The first thing you should do is get rid of it. Then add LEDNR to your SELECT. If you look at the domain for that field, you'll see that it is always '00'. Thius should use index COEP~1 which already exists:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF NOT obj_t[] IS INITIAL.
  SELECT kokrs belnr buzei perio wkgbtr objnr gjahr kstar bukrs
    INTO TABLE it_assign_t
    FROM coep
    FOR ALL ENTRIES IN obj_t
    WHERE lednr = '00'
      AND objnr = obj_t-objnr
      AND perio IN s_period.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2009 14:33:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/6370715#M1401741</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-11T14:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: performance in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/6370716#M1401742</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;Delete adjacent duplicates in obj_t[] internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, use ST05 and SE30 for your analysis. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;creating a secondary index is always not the solution , check the &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection parameters if you can change use for fetch of data from table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Dec 2009 16:36:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/6370716#M1401742</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-11T16:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: performance in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/6370717#M1401743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the above solutions didn't help, you can try doing a range with the values of obj_t and using this instead the for all entries statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Dec 2009 00:16:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/6370717#M1401743</guid>
      <dc:creator>bettinasilveira</dc:creator>
      <dc:date>2009-12-13T00:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: performance in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/6370718#M1401744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; you can try doing a range with the values of obj_t and using this instead the for all entries statement&lt;/P&gt;&lt;P&gt;better not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob gave already a solution, all others do not change the index support.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Dec 2009 16:50:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/6370718#M1401744</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-14T16:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: performance in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/6370719#M1401745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;thanks for the reply,it was working absolutely fine.i just wants to ask,how did u analyze this,i mean you expereinced same problem before ort you analysed,so that i just wants to think the same way in the future,:) thanks alot for the answer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Dec 2009 09:19:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/6370719#M1401745</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-15T09:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: performance in select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/6370720#M1401746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, the same question has come up before in the forum, so I knew at the beginning what the problem and answer was.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And yes, I think I had the same problem some time ago and this is how I solved it. The basic idea is to go out of your way to find and use an existing index if you are having performance problems with a SELECT. This is not always possible, but should be tried.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the update.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Dec 2009 14:20:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-in-select-statement/m-p/6370720#M1401746</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-15T14:20:16Z</dc:date>
    </item>
  </channel>
</rss>

