<?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: For all Entries or Loop ? DB-Optimizer Issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-or-loop-db-optimizer-issue/m-p/2310708#M506081</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like your requirement cannot be satisfied with RANGES. You could try writing different selects for the various conditions..&lt;/P&gt;&lt;P&gt;or build two ranges, one fore matnr and one for werks, and use those.&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;Sudha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 May 2007 15:54:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-14T15:54:05Z</dc:date>
    <item>
      <title>For all Entries or Loop ? DB-Optimizer Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-or-loop-db-optimizer-issue/m-p/2310704#M506077</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;FOR ALL ENTRIES is a WHERE condition with many ORs. Is it Right that the DB-Optimizer stop to Optimize when there is an OR in the WHERE Condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it better to use LOOP ENDLOOP when I have keys in my WHERE condition to avoid an full table scan with FOR  ALL ENTRIES? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sinan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2007 15:08:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-or-loop-db-optimizer-issue/m-p/2310704#M506077</guid>
      <dc:creator>sinan_keklik</dc:creator>
      <dc:date>2007-05-14T15:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: For all Entries or Loop ? DB-Optimizer Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-or-loop-db-optimizer-issue/m-p/2310705#M506078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sinan,&lt;/P&gt;&lt;P&gt;Yes, you  are right. &lt;/P&gt;&lt;P&gt;OR condition in your where clause will neglect the search through index .&lt;/P&gt;&lt;P&gt;try to replace it wil IN condition. if not you can go for Loop-Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but pls check the performance of both using "get runtime" command. use the better one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;madhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2007 15:11:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-or-loop-db-optimizer-issue/m-p/2310705#M506078</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-14T15:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: For all Entries or Loop ? DB-Optimizer Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-or-loop-db-optimizer-issue/m-p/2310706#M506079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sinan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create ranges for each of the criteria in the where clause. Polutae the ranges and use them in the where clause using the IN operator.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2007 15:26:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-or-loop-db-optimizer-issue/m-p/2310706#M506079</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-14T15:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: For all Entries or Loop ? DB-Optimizer Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-or-loop-db-optimizer-issue/m-p/2310707#M506080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can I create RANGES for more than one FIELDS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like an internal Table with for example Matnr and Werks.&lt;/P&gt;&lt;P&gt;I need something like &lt;/P&gt;&lt;P&gt;                                  WHERE matnr = itab-matnr[1] and werks = itab-werks[1]&lt;/P&gt;&lt;P&gt;                                          OR matnr = itab-matnr[2] and werks = itab-werks[2]&lt;/P&gt;&lt;P&gt;                                           and so on &lt;/P&gt;&lt;P&gt;Sinan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2007 15:33:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-or-loop-db-optimizer-issue/m-p/2310707#M506080</guid>
      <dc:creator>sinan_keklik</dc:creator>
      <dc:date>2007-05-14T15:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: For all Entries or Loop ? DB-Optimizer Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-or-loop-db-optimizer-issue/m-p/2310708#M506081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like your requirement cannot be satisfied with RANGES. You could try writing different selects for the various conditions..&lt;/P&gt;&lt;P&gt;or build two ranges, one fore matnr and one for werks, and use those.&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;Sudha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2007 15:54:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-or-loop-db-optimizer-issue/m-p/2310708#M506081</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-14T15:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: For all Entries or Loop ? DB-Optimizer Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-or-loop-db-optimizer-issue/m-p/2310709#M506082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can I make 2 Ranges and say matnr_range[1] and werks_range[1]?&lt;/P&gt;&lt;P&gt;I think with 2 Ranges the wrong combination matnr_range[1] and werks_range[2] will be shown, too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 7000 Keys.&lt;/P&gt;&lt;P&gt;Different Selects with LOOP is perhaps faster than FOR ALL ENTRIES. Is there perhaps any other possibility than 7000 SELECTs.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;Sinan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2007 16:06:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-or-loop-db-optimizer-issue/m-p/2310709#M506082</guid>
      <dc:creator>sinan_keklik</dc:creator>
      <dc:date>2007-05-14T16:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: For all Entries or Loop ? DB-Optimizer Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-or-loop-db-optimizer-issue/m-p/2310710#M506083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sinan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when you have to compare many values of the field use the 'IN' operator in select...like..&lt;/P&gt;&lt;P&gt;select matnr werks  f1 f2 f3  form &amp;lt;dbtab&amp;gt; into itab &lt;/P&gt;&lt;P&gt;                     where matnr in (mat1,mat2,mat3...)&lt;/P&gt;&lt;P&gt;                      and   werks in (werk1,werk2,....)...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you have a specific  combination of fields to selct from.....for all entries is  a better option ... this works like a nested select..endselect...&lt;/P&gt;&lt;P&gt;populate a table with your field combinations and then use FOR ALL ENTRIES....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vidya..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 May 2007 04:04:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-or-loop-db-optimizer-issue/m-p/2310710#M506083</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-15T04:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: For all Entries or Loop ? DB-Optimizer Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-or-loop-db-optimizer-issue/m-p/2310711#M506084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Question is:&lt;/P&gt;&lt;P&gt;What is faster? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To use FOR ALL ENTRIES with 7000 n-1 Keyfields (This will supposably be 7000 FULL TABLE SCANs) or LOOP ENDLOOP and make 7000 Selects with n-1 keyfields (which will find for each of the 7000 n-1 keyfields the recordset without a full table scan).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any One gain experience about that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sinan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 May 2007 06:31:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-or-loop-db-optimizer-issue/m-p/2310711#M506084</guid>
      <dc:creator>sinan_keklik</dc:creator>
      <dc:date>2007-05-15T06:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: For all Entries or Loop ? DB-Optimizer Issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-or-loop-db-optimizer-issue/m-p/2310712#M506085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sinan!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As long as your where-clause is the same, the for-all-entries should be faster. But in case DB-optimizer runs into troubles and translates this version in a strange way, loop can be faster, too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just code both ways and measure the runtime. That should give you the answer for sure without any blind guesses.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 May 2007 07:18:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-or-loop-db-optimizer-issue/m-p/2310712#M506085</guid>
      <dc:creator>christian_wohlfahrt</dc:creator>
      <dc:date>2007-05-15T07:18:23Z</dc:date>
    </item>
  </channel>
</rss>

