<?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: inner join and into corresponding fields performance, in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-and-into-corresponding-fields-performance/m-p/4497730#M1064243</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Inner joins are very fast when joining the header and item table with all the key fields in the statement. Also when joining 2 tables, check the technical setting of the tables you are joining. The combined no of records in the table should not exceed 100,000 records. &lt;/P&gt;&lt;P&gt;Instead of using into corrosponding , declare the internal table with only the fields that you are selecting in the same order and directly use into, the select won't search for corrosponding field in ITAB but directly move the data in the order of selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prashant.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Oct 2008 10:28:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-10-07T10:28:31Z</dc:date>
    <item>
      <title>inner join and into corresponding fields performance,</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-and-into-corresponding-fields-performance/m-p/4497725#M1064238</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 am still not very clear about the performance aspect of inner join and into corresponding fields...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i know that corresponding fields affects memory peformance ..but does it affect database performance also ie can we have time_out in a select into corresponding fields?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also i am not still clear why inner join sometimes improves databse performance for eg i want to select from mkpf and then mseg i have all the key fields so should i go for fae and select individually or do a inner join....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am rellay confused with these two points and very interested to understand these concepts...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2008 06:53:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-and-into-corresponding-fields-performance/m-p/4497725#M1064238</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-06T06:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: inner join and into corresponding fields performance,</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-and-into-corresponding-fields-performance/m-p/4497726#M1064239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sweta&lt;/P&gt;&lt;P&gt;If you use innerjoin timeout error may occur if there are a large number of entries...&lt;/P&gt;&lt;P&gt;But performance wise innerjoin is preferable...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if u are facing time out error the you can do one thing..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at one table and put the select query on the other table inside that. Performance wise its not prefferable..But to avoid time out error you can use the same.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2008 07:02:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-and-into-corresponding-fields-performance/m-p/4497726#M1064239</guid>
      <dc:creator>former_member195383</dc:creator>
      <dc:date>2008-10-06T07:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: inner join and into corresponding fields performance,</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-and-into-corresponding-fields-performance/m-p/4497727#M1064240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sweta,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;an inner join can be faster than several separated SQL calls because the database needs to scan the necessary tables/indexes only once - and in an efficient manner because it knows in advance that you have to retrieve data form another table via join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The performance is mainly depending on &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;your WHERE clause for filtering the result set (should be effective reduce the number of rows you need for &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;processing after in your program)&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;if indexes can be used or not (indexes of the joined tables should contain the join fields and fields of the WHERE clause &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have a join like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Select scarrid~carrid  spfli~cityfrom 
     from scarr innerjoin spfli on scarrid~carrid = spfli~carrid 
      into corresponding fields of table itab 
     where spfli~cityfrom ='New York'
endselect .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it is send to the database and it will be in general processed in these steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. parse  (compile the SQL)&lt;/P&gt;&lt;P&gt;2. open   (define a memory area and pointer to the result set : the cursor)&lt;/P&gt;&lt;P&gt;3a.  1st fetch   (get the result set once , set the cursor at the 1st row; fill the corresponding fields)&lt;/P&gt;&lt;P&gt;3b.  next fetches ( loop through it using the cursor ;  fill the corresponding fields)&lt;/P&gt;&lt;P&gt;4. close (free the memory area of the cursor)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You see the performance is mainly defined in step 3a where the complete result set is  retrieved.&lt;/P&gt;&lt;P&gt;Storing the cursor values into the corresponding fields in your program has only a marginal effect on the performance - nevertheless you should always be carefull in using resources as memory and such.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;bye&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2008 07:22:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-and-into-corresponding-fields-performance/m-p/4497727#M1064240</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-06T07:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: inner join and into corresponding fields performance,</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-and-into-corresponding-fields-performance/m-p/4497728#M1064241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@YukonKid&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. parse (compile the SQL)&lt;/P&gt;&lt;P&gt;2. open (define a memory area and pointer to the result set : the cursor)&lt;/P&gt;&lt;P&gt;3a. 1st fetch (get the result set once , set the cursor at the 1st row; fill the corresponding fields)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you really sure. I think the time for setting the first cursor is counted in the open operator, if we are talking of ST05 operations.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2008 07:49:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-and-into-corresponding-fields-performance/m-p/4497728#M1064241</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-06T07:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: inner join and into corresponding fields performance,</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-and-into-corresponding-fields-performance/m-p/4497729#M1064242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The into corrsponding fields is definitely no large overhead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And about the join, there is unfortunately no general solution, it depends on the available indexes for the involved tables. &lt;/P&gt;&lt;P&gt;A join should be good:&lt;/P&gt;&lt;P&gt;+ if the WHERE condition can restrict the number of hits on one table to a reasonable number and uses an index&lt;/P&gt;&lt;P&gt;+ and if the ON condition for the next table uses fields on an index&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Join can go wrong, if too many indexes are available, then a wrong one can be used, when leads to a poor performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Always check SQL trace, check whether the join works correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2008 07:54:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-and-into-corresponding-fields-performance/m-p/4497729#M1064242</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-06T07:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: inner join and into corresponding fields performance,</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-and-into-corresponding-fields-performance/m-p/4497730#M1064243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Inner joins are very fast when joining the header and item table with all the key fields in the statement. Also when joining 2 tables, check the technical setting of the tables you are joining. The combined no of records in the table should not exceed 100,000 records. &lt;/P&gt;&lt;P&gt;Instead of using into corrosponding , declare the internal table with only the fields that you are selecting in the same order and directly use into, the select won't search for corrosponding field in ITAB but directly move the data in the order of selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prashant.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Oct 2008 10:28:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-and-into-corresponding-fields-performance/m-p/4497730#M1064243</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-07T10:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: inner join and into corresponding fields performance,</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-and-into-corresponding-fields-performance/m-p/4497731#M1064244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; The combined no of records in the table should not exceed 100,000 records. &lt;/P&gt;&lt;P&gt;of course smaller is faster, but if it does then the join is also the only option, a FAE is even worse.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And be aware that the into-corresponding is by orders faster than the select, so be careful with into corresponding with buffered tables, but with slow selects, the overhead is maybe 0.001%&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Oct 2008 10:34:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-and-into-corresponding-fields-performance/m-p/4497731#M1064244</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-07T10:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: inner join and into corresponding fields performance,</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-and-into-corresponding-fields-performance/m-p/4497732#M1064245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;gt; @YukonKid&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; 1. parse (compile the SQL)&lt;/P&gt;&lt;P&gt;&amp;gt; 2. open (define a memory area and pointer to the result set : the cursor)&lt;/P&gt;&lt;P&gt;&amp;gt; 3a. 1st fetch (get the result set once , set the cursor at the 1st row; fill the corresponding fields)&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Are you really sure. I think the time for setting the first cursor is counted in the open operator, if we are talking of ST05 operations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Siegfrid,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maybe it was not clear what I want to express:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you issue a query such as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select *  from a_millions_row_table&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there will be &lt;STRONG&gt;no I/O&lt;/STRONG&gt; , until you actually FETCH a row, then and only then   data will be read  and &lt;/P&gt;&lt;P&gt;processing starts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maybe it's clear now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;bye &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Oct 2008 13:13:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-and-into-corresponding-fields-performance/m-p/4497732#M1064245</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-14T13:13:11Z</dc:date>
    </item>
  </channel>
</rss>

