<?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: SQL - Running slow.. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-running-slow/m-p/1111465#M106350</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;your query seems to be ok.  &lt;/P&gt;&lt;P&gt;create a index for Lifnr and try with that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there is no pointers in the sql query. how many records you are retrieving ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and include some date range ( if possible ) and before the statement use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete adjacent duplicates from table i_zpo_filter by comapring lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;sasi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Oct 2005 09:29:37 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-10-18T09:29:37Z</dc:date>
    <item>
      <title>SQL - Running slow..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-running-slow/m-p/1111463#M106348</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've some performance problem in our production system.&lt;/P&gt;&lt;P&gt;It seems that the table EKPO takes long time...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried some index stuff but with no luck.&lt;/P&gt;&lt;P&gt;Any pointers ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select x_ekpo~ebeln&lt;/P&gt;&lt;P&gt;       x_ekpo~lgort&lt;/P&gt;&lt;P&gt;       x_ekpo~matnr&lt;/P&gt;&lt;P&gt;          from ekpo as x_ekpo&lt;/P&gt;&lt;P&gt;          inner join ekko as x_ekko on x_ekko&lt;SUB&gt;ebeln = x_ekpo&lt;/SUB&gt;ebeln&lt;/P&gt;&lt;P&gt;          into corresponding fields of table i_ekpo_forbidden&lt;/P&gt;&lt;P&gt;          for all entries in i_zpo_filter&lt;/P&gt;&lt;P&gt;          where&lt;/P&gt;&lt;P&gt;          (where_clause)&lt;/P&gt;&lt;P&gt;          AND x_ekko~lifnr = i_zpo_filter-lifnr&lt;/P&gt;&lt;P&gt;          AND x_ekpo~werks = v_werks&lt;/P&gt;&lt;P&gt;          AND x_ekpo~bstyp = 'F'    " Purchasing doc.&lt;/P&gt;&lt;P&gt;          AND x_ekpo~loekz = space  " Deletion indicator&lt;/P&gt;&lt;P&gt;          AND x_ekpo~elikz = space. " Delivery Completed indicator&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2005 09:19:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-running-slow/m-p/1111463#M106348</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-18T09:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: SQL - Running slow..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-running-slow/m-p/1111464#M106349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just Change it like this -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select x_ekpo~ebeln&lt;/P&gt;&lt;P&gt;x_ekpo~lgort&lt;/P&gt;&lt;P&gt;x_ekpo~matnr&lt;/P&gt;&lt;P&gt;from ekko as x_ekko&lt;/P&gt;&lt;P&gt;inner join ekpo as x_ekpo on x_ekko&lt;SUB&gt;ebeln = x_ekpo&lt;/SUB&gt;ebeln&lt;/P&gt;&lt;P&gt;into corresponding fields of table i_ekpo_forbidden&lt;/P&gt;&lt;P&gt;for all entries in i_zpo_filter&lt;/P&gt;&lt;P&gt;where&lt;/P&gt;&lt;P&gt;(where_clause)&lt;/P&gt;&lt;P&gt;AND x_ekko~lifnr = i_zpo_filter-lifnr&lt;/P&gt;&lt;P&gt;AND x_ekpo~werks = v_werks&lt;/P&gt;&lt;P&gt;AND x_ekpo~bstyp = 'F' " Purchasing doc.&lt;/P&gt;&lt;P&gt;AND x_ekpo~loekz = space " Deletion indicator&lt;/P&gt;&lt;P&gt;AND x_ekpo~elikz = space. " Delivery Completed indicator&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2005 09:23:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-running-slow/m-p/1111464#M106349</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-18T09:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: SQL - Running slow..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-running-slow/m-p/1111465#M106350</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;your query seems to be ok.  &lt;/P&gt;&lt;P&gt;create a index for Lifnr and try with that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there is no pointers in the sql query. how many records you are retrieving ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and include some date range ( if possible ) and before the statement use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete adjacent duplicates from table i_zpo_filter by comapring lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;sasi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2005 09:29:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-running-slow/m-p/1111465#M106350</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-18T09:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: SQL - Running slow..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-running-slow/m-p/1111466#M106351</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;here is some points that slow down the query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- 'for all entries in' has the same effect as&lt;/P&gt;&lt;P&gt;LOOP @ ITAB.  SELECT...   ENDLOOP.&lt;/P&gt;&lt;P&gt; so it is not performent at all if the table izpo_filter is big.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- dynamic where clause is not performant neither.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i did give you some usefull info let me know by rewarding me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2005 09:38:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-running-slow/m-p/1111466#M106351</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-18T09:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: SQL - Running slow..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-running-slow/m-p/1111467#M106352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to avoid using 'corresponding fields of '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;declare the struture of your internal table such that you can avoid using 'corresponding fields of ' clause in select statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2005 09:44:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-running-slow/m-p/1111467#M106352</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-18T09:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: SQL - Running slow..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-running-slow/m-p/1111468#M106353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check also that i_zpo_filter has entries, because if it has no entries it will do a select of the whole table without filter and it will be very slow....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check not i_zpo_filter[] is initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2005 10:09:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-running-slow/m-p/1111468#M106353</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-18T10:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: SQL - Running slow..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-running-slow/m-p/1111469#M106354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you done a performance trace to see which index is being used?&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, 18 Oct 2005 14:12:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-running-slow/m-p/1111469#M106354</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-18T14:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: SQL - Running slow..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-running-slow/m-p/1111470#M106355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try using views like MASSEKPO.&lt;/P&gt;&lt;P&gt;YOu can look for other views that might satisfy your conditions. Use where used from SE11 for table EKPO, select 'Views' from the options.&lt;/P&gt;&lt;P&gt;Choose something that fits your requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Look at view WB2_V_EKKO_EKPO2, I ran a comparison between your select and selecting from this view. The view takes just half the time. Beware some fields are named with _I extension.&lt;/P&gt;&lt;P&gt;Like MATNR is MATNR_I.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did not check the join conditions in the view. Pls. check that too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Cyril Alex&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2005 15:18:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-running-slow/m-p/1111470#M106355</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-18T15:18:22Z</dc:date>
    </item>
  </channel>
</rss>

