<?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 Typical problem: Inner join - 5 tables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/typical-problem-inner-join-5-tables/m-p/5139841#M1191295</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'm improving a program performance changing a lot of SELECT SINGLES of the old version for INNER JOINS and this kind of changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The comparing performance test shows that my program is much more faster in the 95% of the cases that I need. But when the amount of data increases (Because they expand the DAYS parameter to select data). My code performance decreasces too much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I improve that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  SELECT zshz012~zz0010 zshz012~zz0012 crmm_prpadm_h~guid
        INTO TABLE gt_data
        FROM zshz012 JOIN crmm_prpadm_h ON
        zshz012~parent_guid EQ crmm_prpadm_h~guid
        WHERE
          crmm_prpadm_h~prp_type    EQ gk_tom_pre AND
          crmm_prpadm_h~prp_status  EQ gk_sta_act AND
          zshz012~zz0012            IN so_date.


  IF NOT gt_data[] IS INITIAL.
    SELECT a~product_ref_guid c~zz0012 b~parent_guid
       INTO TABLE gt_roturas
       FROM  ( ( crmm_prp_prod_i AS a JOIN
                 crmm_prpadm_i   AS b
                     ON a~parent_guid = b~guid ) JOIN
                 zsiz012_new AS c
                     ON a~guid EQ c~guid )
       FOR ALL ENTRIES IN gt_data
       WHERE
         b~parent_guid = gt_data-guid.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Marshal on Feb 5, 2009 1:25 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Feb 2009 12:14:00 GMT</pubDate>
    <dc:creator>Marcal_Oliveras</dc:creator>
    <dc:date>2009-02-05T12:14:00Z</dc:date>
    <item>
      <title>Typical problem: Inner join - 5 tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/typical-problem-inner-join-5-tables/m-p/5139841#M1191295</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'm improving a program performance changing a lot of SELECT SINGLES of the old version for INNER JOINS and this kind of changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The comparing performance test shows that my program is much more faster in the 95% of the cases that I need. But when the amount of data increases (Because they expand the DAYS parameter to select data). My code performance decreasces too much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I improve that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  SELECT zshz012~zz0010 zshz012~zz0012 crmm_prpadm_h~guid
        INTO TABLE gt_data
        FROM zshz012 JOIN crmm_prpadm_h ON
        zshz012~parent_guid EQ crmm_prpadm_h~guid
        WHERE
          crmm_prpadm_h~prp_type    EQ gk_tom_pre AND
          crmm_prpadm_h~prp_status  EQ gk_sta_act AND
          zshz012~zz0012            IN so_date.


  IF NOT gt_data[] IS INITIAL.
    SELECT a~product_ref_guid c~zz0012 b~parent_guid
       INTO TABLE gt_roturas
       FROM  ( ( crmm_prp_prod_i AS a JOIN
                 crmm_prpadm_i   AS b
                     ON a~parent_guid = b~guid ) JOIN
                 zsiz012_new AS c
                     ON a~guid EQ c~guid )
       FOR ALL ENTRIES IN gt_data
       WHERE
         b~parent_guid = gt_data-guid.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Marshal on Feb 5, 2009 1:25 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 12:14:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/typical-problem-inner-join-5-tables/m-p/5139841#M1191295</guid>
      <dc:creator>Marcal_Oliveras</dc:creator>
      <dc:date>2009-02-05T12:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: Typical problem: Inner join - 5 tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/typical-problem-inner-join-5-tables/m-p/5139842#M1191296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marshal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you want to write the query with joins?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or else you can have a look.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT zshz012-zz0010 zshz012-zz0012 &lt;/P&gt;&lt;P&gt;             INTO TABLE gt_data&lt;/P&gt;&lt;P&gt;             FROM zshz012 &lt;/P&gt;&lt;P&gt;            where zshz012-zz0012 IN so_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check not gt_data[] is initial.&lt;/P&gt;&lt;P&gt;select crmm_prpadm_h-guid into table gt_data2&lt;/P&gt;&lt;P&gt;	from crmm_prpadm_h&lt;/P&gt;&lt;P&gt;	for all entries in gt_data&lt;/P&gt;&lt;P&gt;	where crmm_prpadm_h~prp_type    EQ gk_tom_pre AND&lt;/P&gt;&lt;P&gt;          	crmm_prpadm_h~prp_status  EQ gk_sta_act.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is the way u can do it for 1st two joins.&lt;/P&gt;&lt;P&gt;so on and so forth.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;thanx.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 12:50:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/typical-problem-inner-join-5-tables/m-p/5139842#M1191296</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T12:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: Typical problem: Inner join - 5 tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/typical-problem-inner-join-5-tables/m-p/5139843#M1191297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks  Pritha but I don't think that your code improve my performance. You only separated the inner join into 2 select statements&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 12:54:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/typical-problem-inner-join-5-tables/m-p/5139843#M1191297</guid>
      <dc:creator>Marcal_Oliveras</dc:creator>
      <dc:date>2009-02-05T12:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: Typical problem: Inner join - 5 tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/typical-problem-inner-join-5-tables/m-p/5139844#M1191298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you are right. i separated the select statements which enhances the performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you write all separate 4 queries with different selects and "for all entries", you can definitely enhance the code performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 12:58:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/typical-problem-inner-join-5-tables/m-p/5139844#M1191298</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T12:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: Typical problem: Inner join - 5 tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/typical-problem-inner-join-5-tables/m-p/5139845#M1191299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry I don't have the time to look into the details, but how you separate the SELECTs is a bad idea,&lt;/P&gt;&lt;P&gt;you should try to have a join first and then you can add the FOR ALL ENTRIES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With five table there is some analysis necessary but usually it is possible to find a good solution!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2009 20:07:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/typical-problem-inner-join-5-tables/m-p/5139845#M1191299</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-06T20:07:50Z</dc:date>
    </item>
  </channel>
</rss>

