<?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 How performance can be improved in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-how-performance-can-be-improved/m-p/1695003#M304946</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is an index on MKPF for BUDAT, so I think the only thing you can do is to make sure that s_budat is not empty and also contains a small enough range so that not too much data is retrieved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Nov 2006 14:13:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-28T14:13:04Z</dc:date>
    <item>
      <title>Inner Join How performance can be improved</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-how-performance-can-be-improved/m-p/1694997#M304940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;      There is a inner join for fetching data from mkpf and mseg. Now the query is like shown below.what all things can be done to improve the performance.&lt;/P&gt;&lt;P&gt;  SELECT &lt;/P&gt;&lt;P&gt;         b~mblnr&lt;/P&gt;&lt;P&gt;         b~mjahr&lt;/P&gt;&lt;P&gt;         b~zeile&lt;/P&gt;&lt;P&gt;         b~bwart&lt;/P&gt;&lt;P&gt;         b~matnr&lt;/P&gt;&lt;P&gt;         b~werks&lt;/P&gt;&lt;P&gt;         b~lgort&lt;/P&gt;&lt;P&gt;         b~charg&lt;/P&gt;&lt;P&gt;         b~sobkz&lt;/P&gt;&lt;P&gt;         b~lifnr&lt;/P&gt;&lt;P&gt;         b~shkzg&lt;/P&gt;&lt;P&gt;         b~waers&lt;/P&gt;&lt;P&gt;         b~dmbtr&lt;/P&gt;&lt;P&gt;         b~menge&lt;/P&gt;&lt;P&gt;         b~meins&lt;/P&gt;&lt;P&gt;         b~ebeln&lt;/P&gt;&lt;P&gt;         b~ebelp&lt;/P&gt;&lt;P&gt;         b~kostl&lt;/P&gt;&lt;P&gt;         b~aufnr&lt;/P&gt;&lt;P&gt;         b~bukrs&lt;/P&gt;&lt;P&gt;         a~budat&lt;/P&gt;&lt;P&gt;  INTO TABLE imseg&lt;/P&gt;&lt;P&gt;  FROM mkpf AS a INNER JOIN mseg AS b&lt;/P&gt;&lt;P&gt;  ON a&lt;SUB&gt;mblnr = b&lt;/SUB&gt;mblnr AND a&lt;SUB&gt;mjahr = b&lt;/SUB&gt;mjahr&lt;/P&gt;&lt;P&gt;  CLIENT SPECIFIED&lt;/P&gt;&lt;P&gt;  WHERE a~mandt EQ sy-mandt&lt;/P&gt;&lt;P&gt;    AND a~budat IN s_budat&lt;/P&gt;&lt;P&gt;    AND a~vgart IN s_vgart&lt;/P&gt;&lt;P&gt;    AND a~blart IN s_blart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DELETE imseg  WHERE NOT ( sobkz EQ 'K' ) .&lt;/P&gt;&lt;P&gt;  DELETE imseg  WHERE NOT ( bwart = '411' OR bwart = '412' ) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF NOT ( s_matnr IS INITIAL ) .&lt;/P&gt;&lt;P&gt;    DELETE imseg  WHERE NOT ( matnr IN s_matnr ) .&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;  IF NOT ( s_werks IS INITIAL ) .&lt;/P&gt;&lt;P&gt;    DELETE imseg  WHERE NOT ( werks IN s_werks ) .&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;  IF NOT ( s_lifnr IS INITIAL ) .&lt;/P&gt;&lt;P&gt;    DELETE imseg  WHERE NOT ( lifnr IN s_lifnr ) .&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;  IF NOT ( p_bukrs IS INITIAL ) .&lt;/P&gt;&lt;P&gt;    DELETE imseg  WHERE NOT ( bukrs EQ p_bukrs ) .&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Key fields  are not available in the selection screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Shyam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Nov 2006 09:17:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-how-performance-can-be-improved/m-p/1694997#M304940</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-28T09:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Inner Join How performance can be improved</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-how-performance-can-be-improved/m-p/1694998#M304941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Instead of innerjoin, better u use 'for all entries'...&lt;/P&gt;&lt;P&gt;Then see, the performance.&lt;/P&gt;&lt;P&gt;Performance wise it will effective than innerjoin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Nov 2006 09:24:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-how-performance-can-be-improved/m-p/1694998#M304941</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-28T09:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: Inner Join How performance can be improved</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-how-performance-can-be-improved/m-p/1694999#M304942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Earlier in the program it was using FOR ALL ENTRIES but it was taking a lot of time so as these two table sare header and item level table i thought of putting a join b/w them.but problem is as key fields are not available i think it will take a lot of time.That i have to check after moving it to Quality system.Before that i want to know can any more can be done on this for improving the performance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Nov 2006 09:30:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-how-performance-can-be-improved/m-p/1694999#M304942</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-28T09:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: Inner Join How performance can be improved</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-how-performance-can-be-improved/m-p/1695000#M304943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Syam,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Have you checked whether they have used the statement to check internal table is empty or not? &lt;/P&gt;&lt;P&gt;Example : If &amp;lt;itab&amp;gt; is not initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     As you know, if it is not there, FOR ALL ENTRIES will fetech entire data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      What you said is right, iF THEY ARE NOT PROPER KEY FIELD, OBVIOUS, THERE WILL NOT BE ANY ALTERNATIVE TO REDUSE THE TIME IN FETCHING THE DATA.  So, hope, there is no alternative.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Because the tables you have mentioned are big db tables, Ask your functional guy for any alternative tables for the same fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Manju.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  If you think helpful, reward points.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Nov 2006 09:39:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-how-performance-can-be-improved/m-p/1695000#M304943</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-28T09:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: Inner Join How performance can be improved</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-how-performance-can-be-improved/m-p/1695001#M304944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;        One more thing you can do is to create a database view (Which always uses inner join) and then use the technical settings to buffer the data of this view.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Nov 2006 10:46:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-how-performance-can-be-improved/m-p/1695001#M304944</guid>
      <dc:creator>seshatalpasai_madala</dc:creator>
      <dc:date>2006-11-28T10:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: Inner Join How performance can be improved</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-how-performance-can-be-improved/m-p/1695002#M304945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shyam,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   First thing check whether for all entries is coded properly i.e check wther the driver internal table is checked for not initial condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Next thing if u cant achive through for all entries it is better to approach DBA people for secondary index creation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Nov 2006 11:51:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-how-performance-can-be-improved/m-p/1695002#M304945</guid>
      <dc:creator>Bharathi_j</dc:creator>
      <dc:date>2006-11-28T11:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: Inner Join How performance can be improved</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-how-performance-can-be-improved/m-p/1695003#M304946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is an index on MKPF for BUDAT, so I think the only thing you can do is to make sure that s_budat is not empty and also contains a small enough range so that not too much data is retrieved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Nov 2006 14:13:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-how-performance-can-be-improved/m-p/1695003#M304946</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-28T14:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: Inner Join How performance can be improved</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-how-performance-can-be-improved/m-p/1695004#M304947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shyam!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess, you had once a select for MKPF and a 'for all entries' for MSEG. Depending on the usual selection (the way the potential selection criteria are used), you can try the other way: first select MSEG and then select MKPF 'for all entries'. This second select is fast, it's just a question, if MSEG can be accessed in a good way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is an index M for MSEG (with fields MANDT, MATNR, WERKS, LGORT, BWART, SOBKZ). Currently you give BWART and SOBKZ, the other fields are optional, LGORT you don't specify at all. I think it's quite easy to get all possible LGORT (out from table T001L).&lt;/P&gt;&lt;P&gt;When you report variant restricts MATNR and WERKS, you can fill the fields LGORT, BWART, SOBKZ and you have a 'full' index access for MSEG.&lt;/P&gt;&lt;P&gt;When MATNR (or WERKS) aren't specified, this will be slow, because the result is a full table access for MSEG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case MATNR, WERKS are sometimes specified, you will get best results with a join - then the DB should decide itself if an access for MKPF or an access for MSEG will be done first. At least, that's the case when there is a cost based optimizer working for the SQL translation.&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, 28 Nov 2006 16:22:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-how-performance-can-be-improved/m-p/1695004#M304947</guid>
      <dc:creator>christian_wohlfahrt</dc:creator>
      <dc:date>2006-11-28T16:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: Inner Join How performance can be improved</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-how-performance-can-be-improved/m-p/1695005#M304948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would change the following conditions, move them to where clause.&lt;/P&gt;&lt;P&gt;I would define range for bwart, fill in with your vlaues to EXCLUDE them and then use in where condiiton.&lt;/P&gt;&lt;P&gt;DELETE imseg WHERE NOT ( sobkz EQ 'K' ) .&lt;/P&gt;&lt;P&gt;DELETE imseg WHERE NOT ( bwart = '411' OR bwart = '412' ) .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Nov 2006 17:49:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-how-performance-can-be-improved/m-p/1695005#M304948</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-28T17:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: Inner Join How performance can be improved</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-how-performance-can-be-improved/m-p/1695006#M304949</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;As u have practising joins ,what ever code u have given wil work fine but this wil take lot of time to fetch from the Database.So,instead u can use &amp;lt;b&amp;gt;for all entries&amp;lt;/b&amp;gt;. This makes the performance more efficient.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sharath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Nov 2006 06:12:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-how-performance-can-be-improved/m-p/1695006#M304949</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-29T06:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: Inner Join How performance can be improved</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-how-performance-can-be-improved/m-p/1695007#M304950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please use for all entries.That will increase the performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;kumar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Nov 2006 09:25:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join-how-performance-can-be-improved/m-p/1695007#M304950</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-29T09:25:56Z</dc:date>
    </item>
  </channel>
</rss>

