<?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 .... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries/m-p/3352634#M804235</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;Basically application performance can be broken down into two componets.&lt;/P&gt;&lt;P&gt;1) Good data retrieval, and&lt;/P&gt;&lt;P&gt;2) Good data manipulation/presentation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good data retrieval is acheived by pushing most if not all of the work onto the database engine, and retrieving only what is required.  Hence statements like "Select *" should be avoided.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A inner join pushes the data retrieval to the database, where as a FOR ALL ENTRIES IN data is retreived from the database for the table and compared against the internal table on the application server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is best to join tables using their key fields or those used in an index otherwise a table scan is initiated resulting in the whole table being read by the database.  This may be ok in development with small quantities of data, but can be disasterous in production.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However having said this some tables just can not be joined due to their design.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Feb 2008 02:44:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-05T02:44:13Z</dc:date>
    <item>
      <title>FOR ALL ENTRIES ....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries/m-p/3352625#M804226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the use of FOR ALL ENTRIES    when compared to JOINS  and  what is the  Precaution to take  if u  use FOR ALL ENTRIES ??????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the ITAB is empty then wat  happens if u use FOR ALL ENTRIES on that itab..???????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2008 14:01:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries/m-p/3352625#M804226</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-04T14:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: FOR ALL ENTRIES ....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries/m-p/3352626#M804227</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;To avoid nested select statements we use SELECT FOR ALL ENTRIES statement.&lt;/P&gt;&lt;P&gt;If there r more than 10000 records SELECT FOR ALL ENTRIES is used.&lt;/P&gt;&lt;P&gt;Performance wise SELECT FOR ALL ENTRIES is better to use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------------------------" /&gt;&lt;P&gt;1. duplicate rows are automatically removed&lt;/P&gt;&lt;P&gt;2. if the itab used in the clause is empty , all the rows in the source table will be selected .&lt;/P&gt;&lt;P&gt;3. performance degradation when using the clause on big tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------------------------" /&gt;&lt;P&gt;My advice is NOT to use INNER JOIN and FOR ALL ENTRIES together. It kills the performance,especially when key fields are not passed to WHERE clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First use FOR ALL ENTRIES on table AFKO with SELECT...ENDSELECT statement. And within this SELECT...ENDSELECT write SELECT query to hit AFPO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------------------------" /&gt;&lt;P&gt;check this link:&lt;/P&gt;&lt;P&gt;&lt;A href="http://blogs.ittoolbox.com/sap/db2/archives/for-all-entries-vs-db2-join-8912" target="test_blank"&gt;http://blogs.ittoolbox.com/sap/db2/archives/for-all-entries-vs-db2-join-8912&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Satish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2008 14:05:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries/m-p/3352626#M804227</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-04T14:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: FOR ALL ENTRIES ....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries/m-p/3352627#M804228</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;chk these threads...&lt;/P&gt;&lt;P&gt; &lt;A href="https://forums.sdn.sap.com/click.jspa?searchID=8562094&amp;amp;messageID=4510851" target="test_blank"&gt;https://forums.sdn.sap.com/click.jspa?searchID=8562094&amp;amp;messageID=4510851&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.sdn.sap.com/click.jspa?searchID=8562094&amp;amp;messageID=4530377" target="test_blank"&gt;https://forums.sdn.sap.com/click.jspa?searchID=8562094&amp;amp;messageID=4530377&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.sdn.sap.com/click.jspa?searchID=8562094&amp;amp;messageID=4631616" target="test_blank"&gt;https://forums.sdn.sap.com/click.jspa?searchID=8562094&amp;amp;messageID=4631616&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;priya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2008 14:05:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries/m-p/3352627#M804228</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-04T14:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: FOR ALL ENTRIES ....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries/m-p/3352628#M804229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If ITAB is empty and we use it in FOR ALL ENTRIES addition, then it will lead to a full table scan on the data base table and tries to retrieve all the records from database table.&lt;/P&gt;&lt;P&gt;KindRegards,&lt;/P&gt;&lt;P&gt;khader.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2008 14:12:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries/m-p/3352628#M804229</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-04T14:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: FOR ALL ENTRIES ....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries/m-p/3352629#M804230</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;In a join, the tables (base tables) are combined to form one results table. The join conditions are applied to this results table. The resulting composite for an inner join logic contains only those records for which matching records exist in each base table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Join conditions are not limited to key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If columns from two tables have the same name, then you have to ensure that the field labels are unique by prefixing the table name or a table alias.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A table join is generally the most efficient way to read from the database. The database is responsible for deciding which table is read first and which index is used (DB Optimizer). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At LEFT OUTER JOIN, results tables can also contain entries from the designated left hand table without the presence of corresponding data records (join conditions) from the table on the right. These table fields are filled by the database with null values and are then initialized according to ABAP type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It makes sense to use a LEFT OUTER JOIN when data from the table on the left is needed for which there are no corresponding entries in the table on the right. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following limitations apply for the Left Outer Join:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can only have a table or a view to the right of the JOIN operator, you cannot have another join statement&lt;/P&gt;&lt;P&gt;Only AND can be used as a logical operator in an ON condition.&lt;/P&gt;&lt;P&gt;every comparison in the ON condition must contain a field from the table on the right.&lt;/P&gt;&lt;P&gt;if the FROM clause contains an Outer Join, then all ON conditions must contain at least one 'true' JOIN condition (a condition that contains a field from tab1 and a field from tab2).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------------------------" /&gt;&lt;P&gt;FOR ALL ENTRIES works with a database in a quantity-oriented manner. Initially all data is collected in an internal table. Make sure that this table contains at least one entry (query sy-subrc or DESCRIBE), otherwise the subsequent transaction will be carried out without any restrictions).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT...FOR ALL ENTRIES IN is treated like a SELECT statement with an external OR condition. The system only selects those table entries that meet the logical condition .&lt;/P&gt;&lt;P&gt;Using FOR ALL ENTRIES is recommended when data is not being read from the database, that is, it is already available in the program, for example, if the user has input the data. Otherwise a join is recommended.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The easiest technical option for reading from multiple (dependent) tables is to use nested SELECT statements. The biggest disadvantage of this method is that for every data record contained in the external loop a SELECT statement is run using the database. This leads to a considerably worse performance in client/server systems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you got some clear idea on this .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;lt;REMOVED BY MODERATOR&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;GAURAV J&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alvaro Tejada Galindo on Feb 4, 2008 5:00 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2008 14:13:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries/m-p/3352629#M804230</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-04T14:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: FOR ALL ENTRIES ....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries/m-p/3352630#M804231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please see:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[ JOINS vs. FOR ALL ENTRIES - Which Performs Better?|/people/rob.burbank/blog/2007/03/19/joins-vs-for-all-entries--which-performs-better]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2008 15:24:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries/m-p/3352630#M804231</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-04T15:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: FOR ALL ENTRIES ....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries/m-p/3352631#M804232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For all entries is performance wise better  then the joins, so wherever desired use for all entries instead of joins.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Only precaution u need to take is that the table for which you are taking applying 'FOR ALL ENTRIES'  should not be empty otherwise the select query will fetch all the values from the database table which can be a real performance issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So before making 'FOR ALL ENTRIES' for a table make a check that its not empty.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2008 15:46:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries/m-p/3352631#M804232</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-04T15:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: FOR ALL ENTRIES ....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries/m-p/3352632#M804233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ankit - this is not usually correct. Please see the blog I mentioned above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2008 16:02:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries/m-p/3352632#M804233</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-04T16:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: FOR ALL ENTRIES ....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries/m-p/3352633#M804234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In a workshop given by SAP specialists we were told to use JOIN instead of FOR ALL ENTRIES, even if the JOIN is among 1000 tables, it will have better performance. That's what we were told....I don't know. I've read somewhere that when using JOIN the system can calculate the size of the result, hence manage memory and the other rources more specifically, but with the FOR ALL ENTRIES statement the system cannot estimate the result and won't size it's internal buffers properly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR ALL ENTIRES should be used then the internal table has few entries, (less than 20).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more thing, FOR ALL ENTIRES in Sql Server kills the database...(it makes an OR query for each internal table row)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2008 17:18:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries/m-p/3352633#M804234</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-04T17:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: FOR ALL ENTRIES ....</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries/m-p/3352634#M804235</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;Basically application performance can be broken down into two componets.&lt;/P&gt;&lt;P&gt;1) Good data retrieval, and&lt;/P&gt;&lt;P&gt;2) Good data manipulation/presentation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good data retrieval is acheived by pushing most if not all of the work onto the database engine, and retrieving only what is required.  Hence statements like "Select *" should be avoided.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A inner join pushes the data retrieval to the database, where as a FOR ALL ENTRIES IN data is retreived from the database for the table and compared against the internal table on the application server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is best to join tables using their key fields or those used in an index otherwise a table scan is initiated resulting in the whole table being read by the database.  This may be ok in development with small quantities of data, but can be disasterous in production.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However having said this some tables just can not be joined due to their design.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2008 02:44:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries/m-p/3352634#M804235</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-05T02:44:13Z</dc:date>
    </item>
  </channel>
</rss>

