<?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: Speed up select query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/speed-up-select-query/m-p/8136407#M1619939</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jaideep,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your only select-options are on &lt;STRONG&gt;euitrans&lt;/STRONG&gt;, so select all &lt;STRONG&gt;int_ui&lt;/STRONG&gt; values in an internal table with DISTINCT option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then select &lt;STRONG&gt;vstelle&lt;/STRONG&gt;  from &lt;STRONG&gt;euiinstln&lt;/STRONG&gt; INNER JOIN &lt;STRONG&gt;eanl&lt;/STRONG&gt; FOR ALL ENTRIES of your internal table into your result table &lt;STRONG&gt;lt_premises&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope, this will help. Matching database indexes for &lt;STRONG&gt;euiinstln-int_ui&lt;/STRONG&gt;  and &lt;STRONG&gt;eanl-anlage&lt;/STRONG&gt; would be fine. I don't have those tables/views on any of our systems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Klaus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Aug 2011 12:31:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-08-17T12:31:21Z</dc:date>
    <item>
      <title>Speed up select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/speed-up-select-query/m-p/8136405#M1619937</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;&lt;/P&gt;&lt;P&gt;My report needs to scan the entire DB table EANL and cleanse data. Following is the select statement that i need:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT a~vstelle&lt;/P&gt;&lt;P&gt;    INTO TABLE lt_premises&lt;/P&gt;&lt;P&gt;    FROM eanl AS a&lt;/P&gt;&lt;P&gt;   INNER JOIN euiinstln AS b&lt;/P&gt;&lt;P&gt;      ON a&lt;SUB&gt;anlage = b&lt;/SUB&gt;anlage&lt;/P&gt;&lt;P&gt;   INNER JOIN euitrans AS c&lt;/P&gt;&lt;P&gt;      ON b&lt;SUB&gt;int_ui = c&lt;/SUB&gt;int_ui&lt;/P&gt;&lt;P&gt;   WHERE c~ext_ui IN s_esiid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here the user can execute the report without entering anything in the select option s_esiid. In this case the select will need to query the entire EANL table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As expected this takes hell of a time. Can anyone suggests ways to speed this up. I can break the join statement if that can help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jaideep&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 10:49:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/speed-up-select-query/m-p/8136405#M1619937</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-17T10:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Speed up select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/speed-up-select-query/m-p/8136406#M1619938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jaideep,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can use FOR ALL ENTRIES by breaking down this statement and make two select statements , and then debug which select statement is taking more time and then post .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 10:56:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/speed-up-select-query/m-p/8136406#M1619938</guid>
      <dc:creator>vimal</dc:creator>
      <dc:date>2011-08-17T10:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: Speed up select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/speed-up-select-query/m-p/8136407#M1619939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jaideep,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your only select-options are on &lt;STRONG&gt;euitrans&lt;/STRONG&gt;, so select all &lt;STRONG&gt;int_ui&lt;/STRONG&gt; values in an internal table with DISTINCT option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then select &lt;STRONG&gt;vstelle&lt;/STRONG&gt;  from &lt;STRONG&gt;euiinstln&lt;/STRONG&gt; INNER JOIN &lt;STRONG&gt;eanl&lt;/STRONG&gt; FOR ALL ENTRIES of your internal table into your result table &lt;STRONG&gt;lt_premises&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope, this will help. Matching database indexes for &lt;STRONG&gt;euiinstln-int_ui&lt;/STRONG&gt;  and &lt;STRONG&gt;eanl-anlage&lt;/STRONG&gt; would be fine. I don't have those tables/views on any of our systems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Klaus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 12:31:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/speed-up-select-query/m-p/8136407#M1619939</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-17T12:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: Speed up select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/speed-up-select-query/m-p/8136408#M1619940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you intend to, or your requirement is - download all 3 tables content, you have to pay the price for such requirement.&lt;/P&gt;&lt;P&gt;Not only it will be too slow, it may also cause memory issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might be running this program in development which might run successfully, but it might give TIME_OUT or memory dump in production.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would be better to restrict the selection criteria and revise the requirements in development stage only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For all entries or creating a customized view would not make much difference in my opinion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the requirement still holds, you would have to slice up the tables using "up to rows x" and clean up used data - just to avoid memory issues. I dont think performance issue can be solved.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Aug 2011 07:18:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/speed-up-select-query/m-p/8136408#M1619940</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-18T07:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: Speed up select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/speed-up-select-query/m-p/8136409#M1619941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If it is a data cleanup report, it would be better if you make the select-options mandatory, and run the batch jobs with different variants. This is the closest you can get to performance tuning.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Aug 2011 07:22:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/speed-up-select-query/m-p/8136409#M1619941</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-18T07:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: Speed up select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/speed-up-select-query/m-p/8136410#M1619942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jaideep,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Better check the requeriment as wrote before by other poster.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, if you plan to start from external UI try this one:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF s_esiid[] IS INITIAL.
* not informed, read everything
  SELECT a~vstelle
  INTO TABLE lt_premises
  FROM eanl AS a
  WHERE anlage IN (SELECT b~anlage FROM euiinstln AS b
                                   INNER JOIN euitrans AS c
                                   ON b~int_ui = c~int_ui
                                WHERE c~ext_ui IN s_esiid)
ELSE.
* informed, start join with euitrans (filtering by ext_ui)
  SELECT DISTINCT a~vstelle
  INTO TABLE lt_premises
  FROM euitrans AS c INNER JOIN euiinstln AS b
                        ON b~int_ui = c~int_ui
                     INNER JOIN eanl AS a
                        ON a~anlage = b~anlage
  WHERE c~ext_ui IN s_esiid.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunatelly, I don't have these tables populated on my system, so not sure the results, send results to forum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Fernando Da Ros&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Aug 2011 20:06:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/speed-up-select-query/m-p/8136410#M1619942</guid>
      <dc:creator>former_member182114</dc:creator>
      <dc:date>2011-08-22T20:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: Speed up select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/speed-up-select-query/m-p/8136411#M1619943</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;&lt;/P&gt;&lt;P&gt;This requirement is no longer needed as i have come across a different select query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was scanning the entire EANL table as I needed to find those premises which have multiple installations. This functionality can be achieved in a single select statement as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT DISTINCT vstelle&lt;/P&gt;&lt;P&gt;        FROM eanl&lt;/P&gt;&lt;P&gt;        INTO TABLE gt_premises&lt;/P&gt;&lt;P&gt;       GROUP BY vstelle&lt;/P&gt;&lt;P&gt;      HAVING COUNT( * ) &amp;gt; 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for all your responses!&lt;/P&gt;&lt;P&gt;I am closing this thread now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Aug 2011 13:19:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/speed-up-select-query/m-p/8136411#M1619943</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-26T13:19:58Z</dc:date>
    </item>
  </channel>
</rss>

