<?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: how to optimize this select statement  its a simple select.... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406509#M536483</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arora,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I checked this table and your fields of the where clause are not in any index. There is one index that has guid_pobj but you need to create a secondary index that will have both fields of your where clause. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might have been able to join your first table and corcts but accessing corcts with non-key fields would still be a problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so see if creating a secondary index is possible and then test it out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Filler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Dec 2007 19:21:58 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-12-24T19:21:58Z</dc:date>
    <item>
      <title>how to optimize this select statement  its a simple select....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406492#M536466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how to optimize this select statement  as the records in earlier table is abt i million&lt;/P&gt;&lt;P&gt;and this simplet select statement is not executing and taking lot of time&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT  guid   &lt;/P&gt;&lt;P&gt;                stcts       &lt;/P&gt;&lt;P&gt;  INTO table gt_corcts&lt;/P&gt;&lt;P&gt;  FROM   corcts&lt;/P&gt;&lt;P&gt;  FOR all entries in gt_mege&lt;/P&gt;&lt;P&gt;  WHERE  /sapsll/corcts~stcts = gt_mege-ctsex&lt;/P&gt;&lt;P&gt;  and /sapsll/corcts~guid_pobj = gt_Sagmeld-guid_pobj.&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;Arora&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 03:22:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406492#M536466</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T03:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: how to optimize this select statement  its a simple select....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406493#M536467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;are you using sort command before select query ? if not use it will give little bit performance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use primary key in where cluase -&amp;gt; you get good performance but as per requirement some times we should not use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if possible create secondary index for that table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Seshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 03:27:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406493#M536467</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T03:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to optimize this select statement  its a simple select....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406494#M536468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;before using for all entries u should check the previous internal table is initial or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select primary keys first and where cdn also  u should use the primay key fields first.  remove join concepts...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 03:32:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406494#M536468</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T03:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: how to optimize this select statement  its a simple select....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406495#M536469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nishant,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just check all the things given by Sheshu, also try to use PACKAGE SIZE so that the select will not time out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Atish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 03:34:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406495#M536469</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T03:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to optimize this select statement  its a simple select....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406496#M536470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Seshu and all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am sorting the table already and checkng sy-subrc also thats basic&lt;/P&gt;&lt;P&gt;but the earlier internal table hold abt 10lakh records unique guid_pobj as i have sorted th earlier table based on pobj and deletec adjacent duplicates based on pobj&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how does t his statement help and how to create it and what are restriction i createing it and need for it?&lt;/P&gt;&lt;P&gt;if possible create secondary index for that table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Nishant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 04:11:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406496#M536470</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T04:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: how to optimize this select statement  its a simple select....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406497#M536471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi atish&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can u eloborate more on packaze size option and how to use it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;nishant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 04:12:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406497#M536471</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T04:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: how to optimize this select statement  its a simple select....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406498#M536472</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;This is the information I got from SDN once.May be it can help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;USING CURSORS WHILE FETCHING THE DATA&lt;/P&gt;&lt;P&gt;Cursors are useful when large volumes of data have to be processed. Their utility could be appreciated only under such circumstances. The cursor definitely works better when we need to process millions of rows and are approaching close to the limits of "maximum memory allowed to one process&amp;#148;. The reason is that the command 'Fetch' does not transfer the whole processed data from database server to application server in single shot, but does it in small packets. The number of cursors that could be opened by a user is specified in the INITSID.ORA file in ORACLE. Cursors might slow down the performance of the program in certain cases. &lt;/P&gt;&lt;P&gt;In this method we are populating the cursors, which is a kind of internal table, which hold the data for processing. This approach is good since the cursors can hold good number of records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:   C TYPE CURSOR,&lt;/P&gt;&lt;P&gt; WA LIKE equi.&lt;/P&gt;&lt;P&gt;OPEN CURSOR C FOR SELECT * FROM equi&lt;/P&gt;&lt;P&gt;  WHERE &amp;lt;Select condition&amp;gt;&lt;/P&gt;&lt;P&gt;  ORDER BY PRIMARY KEY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO.&lt;/P&gt;&lt;P&gt;  FETCH NEXT CURSOR C INTO WA.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    CLOSE CURSOR C. EXIT.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Do something here&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 04:13:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406498#M536472</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2007-06-28T04:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to optimize this select statement  its a simple select....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406499#M536473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nishant,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you specify the package size with select statement you can restrict the select at a time and avoid the time out error. In your case give the package size may be 25000 or 50000.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just do F1 on package size and you will get the details.&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;Atish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 04:20:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406499#M536473</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T04:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to optimize this select statement  its a simple select....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406500#M536474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi jayanthi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as u told cursor might slow down the performance of the program and iam aiming for better performance... and this selec statement itself is taking hell lot of time because of 10 lakh records in eaarlier table ane we cannnt sort nor do any thing with the earlier table,&lt;/P&gt;&lt;P&gt;not sure if this will work and how to use it&lt;/P&gt;&lt;P&gt;can u tell how to use it in as above select statment &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and if i remove the where condtiong does the performance will degrade or imporove&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 05:57:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406500#M536474</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T05:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to optimize this select statement  its a simple select....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406501#M536475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;to increase the performance u can also use FIELD SYMBOL&lt;/P&gt;&lt;P&gt; field symbol are nothing but just acts like POINTERS &lt;/P&gt;&lt;P&gt;they hold the data ....of the feilds, just like pointers .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i think this will really help u&lt;/P&gt;&lt;P&gt;also&lt;/P&gt;&lt;P&gt;1&amp;gt;clear ur internal table befre u write select&lt;/P&gt;&lt;P&gt;2&amp;gt;try 2 hit on primary keys&lt;/P&gt;&lt;P&gt;3&amp;gt; PACKAGE SIZE is a gud option&lt;/P&gt;&lt;P&gt;all the best &lt;/P&gt;&lt;P&gt;bhanu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 08:01:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406501#M536475</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T08:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to optimize this select statement  its a simple select....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406502#M536476</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;You can try as below.&lt;/P&gt;&lt;P&gt;DATA: C TYPE CURSOR,&lt;/P&gt;&lt;P&gt;WA LIKE equi.&lt;/P&gt;&lt;P&gt;OPEN CURSOR C FOR SELECT guid &lt;/P&gt;&lt;P&gt;stcts &lt;/P&gt;&lt;P&gt;FROM corcts&lt;/P&gt;&lt;P&gt;FOR all entries in gt_mege&lt;/P&gt;&lt;P&gt;WHERE /sapsll/corcts~stcts = gt_mege-ctsex&lt;/P&gt;&lt;P&gt;and /sapsll/corcts~guid_pobj = gt_Sagmeld-guid_pobj.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO.&lt;/P&gt;&lt;P&gt;FETCH NEXT CURSOR C INTO WA.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;CLOSE CURSOR C. EXIT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Do something here&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDDO. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the following situtation.It is working fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types : begin of ty,&lt;/P&gt;&lt;P&gt;       matnr type mara-matnr,&lt;/P&gt;&lt;P&gt;       maktx type makt-maktx,&lt;/P&gt;&lt;P&gt;       end of ty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data itab1 type standard table of mara.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from mara into table itab1.&lt;/P&gt;&lt;P&gt;*if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;*select matnr maktx from makt into table itab for all entries&lt;/P&gt;&lt;P&gt;*in itab1 where matnr = itab1-matnr.&lt;/P&gt;&lt;P&gt;*endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: C TYPE CURSOR,&lt;/P&gt;&lt;P&gt;WA type ty.&lt;/P&gt;&lt;P&gt;OPEN CURSOR C FOR select matnr maktx from makt for all entries&lt;/P&gt;&lt;P&gt;in itab1 where matnr = itab1-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO.&lt;/P&gt;&lt;P&gt;FETCH NEXT CURSOR C INTO WA.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;CLOSE CURSOR C. EXIT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;write : / wa-matnr.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 08:07:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406502#M536476</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2007-06-28T08:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: how to optimize this select statement  its a simple select....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406503#M536477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Atish &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;didnt got much on F1 help can u suggest more for package size &lt;/P&gt;&lt;P&gt;as tehre are sevreal other select statements also for and we are looping it varius inernal tables so where does this package size fits there?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and can u give a example how to use package size as in above statement?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Arora&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 08:11:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406503#M536477</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T08:11:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to optimize this select statement  its a simple select....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406504#M536478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;goto se38, ctrl&lt;EM&gt;f8, type in select, press enter double click on select into, ctrl&lt;/EM&gt;f type in package and press enter, there you'll also find a piece of abap on how to use this&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2007 14:22:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406504#M536478</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-04T14:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to optimize this select statement  its a simple select....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406505#M536479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi all / Atish&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can any one give examplet of package size ans will it avoid time out error&lt;/P&gt;&lt;P&gt;and in my case the data is about 20000 for next select so how to use package size to break this 20000 data to diffrenct packets and how to use for next select statement?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or how to combine all packates to a single next internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;arora&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2007 02:31:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406505#M536479</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-10T02:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to optimize this select statement  its a simple select....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406506#M536480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arora,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using Package size is very simple and you can avoid the time out and as well as the problem because of memory.  Some time if you have too many records in the internal table, then you will get a short dump called TSV_TNEW_PAGE_ALLOC_FAILED.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the sample code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA p_size = 50000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT field1 field2 field3 &lt;/P&gt;&lt;P&gt;   INTO TABLE itab1 PACKAGE SIZE p_size&lt;/P&gt;&lt;P&gt;   FROM dtab&lt;/P&gt;&lt;P&gt;   WHERE &amp;lt;condition&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Other logic or process on the internal table itab1&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FREE itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here the only problem is you have to put the ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;How it works&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the first select it will select 50000 records ( or the p_size you gave).  That will be in the internal table itab1.&lt;/P&gt;&lt;P&gt;In the second select it will clear the 50000 records already there and append next 50000 records from the database table.&lt;/P&gt;&lt;P&gt;So care should be taken to do all the logic or process with in select and endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some ABAP standards may not allow you to use select-endselect.  But this is the best way to handle huge data without short dumps and memory related problems.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using this approach.  My data is much more huge than yours.  At an average of atleast 5 millions records per select.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck and hope this help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kasthuri Rangan Srinivasan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Dec 2007 19:59:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406506#M536480</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-20T19:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to optimize this select statement  its a simple select....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406507#M536481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using the PACKAGE SIZE addition will help only if you have memory problems, not timeout problems. I suspect that you are not using an index properly in the SELECT, but since I do not see that table in our system, I cannot tell you how to proceed. Can you tell us the indexes on your table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Dec 2007 21:51:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406507#M536481</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-20T21:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to optimize this select statement  its a simple select....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406508#M536482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nishant,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I donno why fetching 1 milllion data is giving you TIME OUT. It might be due to in suffeicient hardware support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Packet size can help you select data in multiple packets which obviously can avoid time out. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am fetching data from a table for 10 million records in the internal table and it ran well enough. Sorting before the for all entries might help in te select performance, instead you can also use &lt;STRONG&gt;SORTED table&lt;/STRONG&gt; on the key ctsex and guid_probj. Also &lt;STRONG&gt;delete adjacent duplicates&lt;/STRONG&gt; based on ctsex and guid_probj which wil reduce data in the driver table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Always check for initial condition before using for all entries&lt;/STRONG&gt;.&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arun Devidas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Dec 2007 19:12:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406508#M536482</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-24T19:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to optimize this select statement  its a simple select....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406509#M536483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arora,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I checked this table and your fields of the where clause are not in any index. There is one index that has guid_pobj but you need to create a secondary index that will have both fields of your where clause. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might have been able to join your first table and corcts but accessing corcts with non-key fields would still be a problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so see if creating a secondary index is possible and then test it out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Filler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Dec 2007 19:21:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-optimize-this-select-statement-its-a-simple-select/m-p/2406509#M536483</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-24T19:21:58Z</dc:date>
    </item>
  </channel>
</rss>

