<?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 Tuning on a Select Query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331739#M168971</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lijo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sure you use as many of the primary key fields as possible in your WHERE clause.  Also ensure that they appear in the WHERE clause in the same order as in the PK.  If you can't use every PK field then try and use those that appear first.  This should help to improve the performance of the select.  Also, if CLIENT relates to the MANDT field e.g. Client 30 on your DEV server then I don;t think you need to include it as  where condition as SAP will do that automatically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You appear to have the where statements in the best possible order, you just need to insert the other PK fields if you can.  Also, it is always recommended to check that the table you are finding all entries for has data i.e. CHECK NOT tb_fkkvkp IS INITIAL.  If it is empty then rather than returning no rows, SAP will return ALL rows - as if the gpart and vkont criteria were not there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this is of help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 May 2006 10:00:16 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-05-04T10:00:16Z</dc:date>
    <item>
      <title>Performance Tuning on a Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331734#M168966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We have a select statement as mentioned below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      SELECT loobj1 gpart vkont proid tdate lotyp lockr&lt;/P&gt;&lt;P&gt;      INTO TABLE tb_dfkklocks&lt;/P&gt;&lt;P&gt;         FROM dfkklocks&lt;/P&gt;&lt;P&gt;         FOR ALL ENTRIES IN tb_fkkvkp&lt;/P&gt;&lt;P&gt;         WHERE&lt;/P&gt;&lt;P&gt;        lotyp  = '02'&lt;/P&gt;&lt;P&gt;         AND   proid  = '01'&lt;/P&gt;&lt;P&gt;         AND   lockr &amp;gt;= '0'&lt;/P&gt;&lt;P&gt;         AND   lockr &amp;lt;= '9'&lt;/P&gt;&lt;P&gt;         AND   gpart = tb_fkkvkp-gpart&lt;/P&gt;&lt;P&gt;         AND   vkont = tb_fkkvkp-vkont.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have Primary key as shown below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLIENT&lt;/P&gt;&lt;P&gt;LOOBJ1&lt;/P&gt;&lt;P&gt;LOTYP&lt;/P&gt;&lt;P&gt;PROID&lt;/P&gt;&lt;P&gt;LOCKR&lt;/P&gt;&lt;P&gt;FDATE&lt;/P&gt;&lt;P&gt;TDATE&lt;/P&gt;&lt;P&gt;GPART&lt;/P&gt;&lt;P&gt;VKONT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have a secondary index only on TDATE. What can be the ideal select stement to improve the performance?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lijo Joseph&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 May 2006 09:36:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331734#M168966</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-04T09:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Tuning on a Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331735#M168967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi make use of your primary keys in the WHERE clause for improving the performance.Also note that it is advisable and good to check your itab before using it with the FOR ALL ENRTIES variant.Eg..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF NOT &amp;lt;ur itab&amp;gt; IS INITIAL.&lt;/P&gt;&lt;P&gt; &amp;lt;ur select query&amp;gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Abdul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 May 2006 09:45:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331735#M168967</guid>
      <dc:creator>abdul_hakim</dc:creator>
      <dc:date>2006-05-04T09:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Tuning on a Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331736#M168968</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;If we use for all entries means all primary keys must be select.then only performance will be increase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT loobj1 lotyp proid lockr fdate tdate gpart vkont&lt;/P&gt;&lt;P&gt;INTO TABLE tb_dfkklocks&lt;/P&gt;&lt;P&gt;FROM dfkklocks&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN tb_fkkvkp&lt;/P&gt;&lt;P&gt;WHERE&lt;/P&gt;&lt;P&gt;lotyp = '02'&lt;/P&gt;&lt;P&gt;AND proid = '01'&lt;/P&gt;&lt;P&gt;AND lockr &amp;gt;= '0'&lt;/P&gt;&lt;P&gt;AND lockr &amp;lt;= '9'&lt;/P&gt;&lt;P&gt;AND gpart = tb_fkkvkp-gpart&lt;/P&gt;&lt;P&gt;AND vkont = tb_fkkvkp-vkont.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plz reward points if it is useful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;suma.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 May 2006 09:47:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331736#M168968</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-04T09:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Tuning on a Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331737#M168969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have mentioned partial keys from the primary Key. So &lt;/P&gt;&lt;P&gt;1) should i use partial keys or &lt;/P&gt;&lt;P&gt;2) use an index and then remove the other data from internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which method is best?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lijo Joseph&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 May 2006 09:51:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331737#M168969</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-04T09:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Tuning on a Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331738#M168970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;it doesn't meant that you should make use of all of your key fields.use whatever is required in your scenario and leave the others provided your key should be so selective for eg fetching entires from MARA based on Material or Plant would be so selective and it will improve your performance.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Abdul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 May 2006 09:54:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331738#M168970</guid>
      <dc:creator>abdul_hakim</dc:creator>
      <dc:date>2006-05-04T09:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Tuning on a Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331739#M168971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lijo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sure you use as many of the primary key fields as possible in your WHERE clause.  Also ensure that they appear in the WHERE clause in the same order as in the PK.  If you can't use every PK field then try and use those that appear first.  This should help to improve the performance of the select.  Also, if CLIENT relates to the MANDT field e.g. Client 30 on your DEV server then I don;t think you need to include it as  where condition as SAP will do that automatically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You appear to have the where statements in the best possible order, you just need to insert the other PK fields if you can.  Also, it is always recommended to check that the table you are finding all entries for has data i.e. CHECK NOT tb_fkkvkp IS INITIAL.  If it is empty then rather than returning no rows, SAP will return ALL rows - as if the gpart and vkont criteria were not there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this is of help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 May 2006 10:00:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331739#M168971</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-04T10:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Tuning on a Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331740#M168972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Andy,&lt;/P&gt;&lt;P&gt;Thanks for the info. But My question is Which mwthod is best using 5 fields from Primary key in the where statement or using one field which got an index and then delete the other data from the internal table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you guide me on this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;LIjo Joseph&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 May 2006 10:05:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331740#M168972</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-04T10:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Tuning on a Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331741#M168973</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 would prefer your 2nd point(use an index and then remove the other data from internal table).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; For all entries will work like ,it will remove the duplicate reords in the internal table automatically.so using the complete index is best preferable.suppose in your table 8 r the key fields.if you use 5 fields in select not in where condition.if we found 2 records with same data in corresponding 5 key fields and different data for 6,7 and 8 fields.system will select only 1 record instead of selecting the 2 records.suppose if we give complete index then we can select 2 records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;suma.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 May 2006 10:10:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331741#M168973</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-04T10:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Tuning on a Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331742#M168974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lijo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suspect that as you are not using the full PK and specifcally not the leftmost PK fields then using the secondary index may well be more efficient in terms of DB load &amp;lt;b&amp;gt;BUT&amp;lt;/b&amp;gt; you will more than likely end up reading an awful lot of data which you end up deleting.  Therefore I think the best approach will depend on the data in the table.  Consequently, it might be worth running some performance tests against both options.&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 May 2006 10:22:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331742#M168974</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-04T10:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Tuning on a Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331743#M168975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Lijo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As your select doesn't contain the first part of the primary key (LOOBJ1)it is going to read seq. however if you have index build already then using the alternate index read can be better. However my fear is it may fetch you lot of data in internal table. But second option is better considering limited options.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 May 2006 10:53:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331743#M168975</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-04T10:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Tuning on a Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331744#M168976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai Lijo&lt;/P&gt;&lt;P&gt;give the primary key fields in top of the where clause because it will retrive all the common fields form both the table and then filter the next conditions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;otherwise it retrives the total fields it will take a lot of memory&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check it  the following modification.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT loobj1 gpart vkont proid tdate lotyp lockr&lt;/P&gt;&lt;P&gt;INTO TABLE tb_dfkklocks&lt;/P&gt;&lt;P&gt;FROM dfkklocks&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN tb_fkkvkp&lt;/P&gt;&lt;P&gt;WHERE&lt;/P&gt;&lt;P&gt;    gpart = tb_fkkvkp-gpart&lt;/P&gt;&lt;P&gt;AND vkont = tb_fkkvkp-vkont&lt;/P&gt;&lt;P&gt;AND lotyp = '02'&lt;/P&gt;&lt;P&gt;AND proid = '01'&lt;/P&gt;&lt;P&gt;AND lockr &amp;gt;= '0'&lt;/P&gt;&lt;P&gt;AND lockr &amp;lt;= '9'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Sreenivasulu P.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Sreenivasulu Ponnadi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 May 2006 10:57:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331744#M168976</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-04T10:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Tuning on a Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331745#M168977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;lt;b&amp;gt;ranges: LOOBJ1 like dfkklocks-LOOBJ1,&lt;/P&gt;&lt;P&gt;        FDATE like dfkklocks-FDATE,&lt;/P&gt;&lt;P&gt;        tDATE like dfkklocks-tDATE. &amp;lt;/b&amp;gt;   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;if not tb_fkkvkp[] is initial.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;SELECT loobj1 gpart vkont proid tdate lotyp lockr&lt;/P&gt;&lt;P&gt;INTO TABLE tb_dfkklocks &amp;lt;b&amp;gt;package size 100&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;FROM dfkklocks&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN tb_fkkvkp&lt;/P&gt;&lt;P&gt;WHERE LOOBJ1 in r_LOOBJ1&lt;/P&gt;&lt;P&gt;and lotyp = '02'&lt;/P&gt;&lt;P&gt;and proid = '01'&lt;/P&gt;&lt;P&gt;AND lockr &amp;gt;= '0'&lt;/P&gt;&lt;P&gt;AND lockr &amp;lt;= '9'&lt;/P&gt;&lt;P&gt;and FDATE in r_FDATE&lt;/P&gt;&lt;P&gt;and tDATE in r_tDATE&lt;/P&gt;&lt;P&gt;AND gpart = tb_fkkvkp-gpart&lt;/P&gt;&lt;P&gt;AND vkont = tb_fkkvkp-vkont.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;endif.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 May 2006 11:10:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331745#M168977</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-04T11:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Tuning on a Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331746#M168978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sravanthi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mentioning package size 100 will impriove the performance?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regardsl&lt;/P&gt;&lt;P&gt;Lijo Joseph&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 May 2006 11:35:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331746#M168978</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-04T11:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Tuning on a Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331747#M168979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1) Make sure that TB_FKKVKP is not empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Remove duplicate entries from TB_FKKVKP comparing GPART and VKONT. If need be transfer these values to a seperate sub table, (and FREE that after use).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) Combine the LOCKR conditions into a single line, either using the BETWEEN option or a new RANGE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) Make sure that the fields LOTYP, PROID and LOCKR are of the same type as the constants you are checking. You should be using CONSTANTS for the fixed values '02', '01', '0' and '9' anyway. Changing field types should be avoided.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have not told us the field definitions of the primary key fields. Neither do we know how much variation there is for each field. So we cannot advise which order to construct any new index, if that is to be tried.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MattG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 May 2006 11:43:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331747#M168979</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-04T11:43:52Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Tuning on a Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331748#M168980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lijo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Couple of pointers from my end.&lt;/P&gt;&lt;P&gt; 1). Try avoiding a FOR ALL ENTRIES if the base table is huge. Instead use a array fetch and pick up more data instead of trying to restrict the data using a FOR ALL ENTRIES as this does a LOOP on the database while selecting the data. &lt;/P&gt;&lt;P&gt; So i would suggest not use FOR ALL ENTRIES if the base table is huge. So analyse before using a select query. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 2). It is actually very difficult to mention which option is better. I would say that it all depends on the scenario. What amount of data is to be read, from which table it is being read, what kind of processing is required on database,..... and many more analysis goes to write a an efficient select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 3). If i am not wrong i think if you are using a FOR ALL ENTRIES and dont specify the key completely then there is no gaurentee that you fetch all the unique records. The system will compare all the character fields as a KEY field and it will not fetch all the records. So while using a FOR ALL ENTRIES its recommended to use all the key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 4). If you would like to really spend time and work on a efficient select statement then try using the tcode ST05 --&amp;gt; Select the button EXPLAIN SQL REQUEST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; type in your select query and see what is the cost of the select statement fired on the database. This will help you to select the best statement. This is a very useful tool if we have complex select statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Hope this info is helpful.&lt;/P&gt;&lt;P&gt; Cheers&lt;/P&gt;&lt;P&gt; VJ&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Vijayendra  Rao&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 May 2006 12:44:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331748#M168980</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-04T12:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Tuning on a Select Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331749#M168981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lijo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DFKKLOCKS is a monster table, do not use FOR ALL ENTRIES. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sanju&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 May 2006 13:22:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-tuning-on-a-select-query/m-p/1331749#M168981</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-04T13:22:58Z</dc:date>
    </item>
  </channel>
</rss>

