<?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: Select performance in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/3021221#M714269</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I created a new index in LIPS and now the performance is better.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Nov 2007 08:42:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-11-15T08:42:00Z</dc:date>
    <item>
      <title>Select performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/3021215#M714263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello to everyone,&lt;/P&gt;&lt;P&gt;I have to improve the performance of this select, because it takes several minutes.&lt;/P&gt;&lt;P&gt;Could someone help me ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; SELECT LIKP&lt;SUB&gt;VBELN LIKP&lt;/SUB&gt;LFDAT LIKP~WADAT_IST&lt;/P&gt;&lt;P&gt;           LIPS&lt;SUB&gt;POSNR LIPS&lt;/SUB&gt;LFIMG LIPS&lt;SUB&gt;MEINS LIPS&lt;/SUB&gt;VGBEL LIPS~VGPOS&lt;/P&gt;&lt;P&gt;          INTO CORRESPONDING FIELDS OF TABLE LT_LIPS&lt;/P&gt;&lt;P&gt;           FROM LIKP JOIN LIPS ON LIKP&lt;SUB&gt;VBELN =  LIPS&lt;/SUB&gt;VBELN&lt;/P&gt;&lt;P&gt;           FOR ALL ENTRIES IN P_ITEM&lt;/P&gt;&lt;P&gt;           WHERE LIPS~VGBEL = P_VBELN&lt;/P&gt;&lt;P&gt;           AND   LIPS~VGPOS = P_ITEM-POSNR.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2007 15:42:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/3021215#M714263</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-13T15:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Select performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/3021216#M714264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You aren't using a key filed in the SELECT, so there's not much you can do. But try this anyway:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SORT p_item BY posnr.
DELETE ADJACENT DUPLICATES FROM p_item COMPARING posnr.

SELECT likp~vbeln likp~lfdat likp~wadat_ist
       lips~posnr lips~lfimg lips~meins lips~vgbel lips~vgpos
  INTO CORRESPONDING FIELDS OF TABLE lt_lips
   FROM likp JOIN lips ON likp~vbeln =  lips~vbeln
   FOR ALL entries IN p_item
   WHERE lips~vgbel = p_vbeln
   AND   lips~vgpos = p_item-posnr.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2007 15:52:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/3021216#M714264</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-13T15:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: Select performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/3021217#M714265</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; Avoid &amp;lt;b&amp;gt;CORRESPONDING FIELDS OF&amp;lt;/b&amp;gt;, this major impact on this query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Declare internal table table only with the required fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if it helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Satish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2007 16:43:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/3021217#M714265</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-13T16:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: Select performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/3021218#M714266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the move into corresponding is no issue with the join!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the indexes on the two tables LIKP and LIPS and the size of tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read this blog on the SQL trace:&lt;/P&gt;&lt;P&gt;/people/siegfried.boes/blog/2007/09/05/the-sql-trace-st05-150-quick-and-easy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the explain and try to understand selectivity, only with a selective index support you can get good performance.&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, 13 Nov 2007 17:28:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/3021218#M714266</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-13T17:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: Select performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/3021219#M714267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try using this code. Let me know if this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF ty_lips,
         vbeln     TYPE lips-vbeln    ,
         posnr     TYPE lips-posnr    ,
         lfimg     TYPE lips-lfimg    ,
         meins     TYPE lips-meins    ,
         vgbel     TYPE lips-vgbel    ,
         vgpos     TYPE lips-vgpos    ,
         lfdat     TYPE likp-lfdat    ,
         wadat_ist TYPE likp-wadat_ist,
       END OF ty_lips,

       BEGIN OF ty_likp,
         vbeln     TYPE likp-vbeln    ,
         lfdat     TYPE likp-lfdat    ,
         wadat_ist TYPE likp-wadat_ist,
       END OF ty_likp.

DATA:  w_lips      TYPE                 ty_lips ,
       w_likp      TYPE                 ty_likp ,
       w_index     TYPE                 sy-tabix,

       lt_item     LIKE        TABLE OF p_item  ,
       lt_lips     TYPE        TABLE OF ty_lips ,
       lt_lips_tmp TYPE        TABLE OF ty_lips ,
       lt_likp     TYPE HASHED TABLE OF ty_likp
         WITH UNIQUE KEY vbeln.

IF NOT p_item[] IS INITIAL.

  lt_item[] = p_item[].

  SORT lt_item BY posnr.

  DELETE ADJACENT DUPLICATES FROM lt_item COMPARING posnr.

  SELECT vbeln
         posnr
         lfimg
         meins
         vgbel
         vgpos
    FROM lips
    INTO TABLE lt_lips
    FOR ALL ENTRIES IN lt_item
    WHERE vgbel EQ p_vbeln
    AND   vgpos EQ lt_item-posnr.

  IF sy-subrc EQ 0.

    SORT lt_lips BY vbeln posnr.

    lt_lips_tmp[] = lt_lips[].

    DELETE ADJACENT DUPLICATES FROM lt_lips_tmp COMPARING vbeln.

    SELECT vbeln
           lfdat
           wadat_ist
      FROM likp
      INTO TABLE lt_likp
      FOR ALL ENTRIES IN lt_lips_tmp
      WHERE vbeln EQ lt_lips_tmp-vbeln.

  ENDIF.


  LOOP AT lt_lips INTO w_lips.

    w_index = sy-tabix.

    AT NEW vbeln.
      READ TABLE lt_likp INTO w_likp WITH KEY vbeln = w_lips-vbeln
        TRANSPORTING
          lfdat
          wadat_ist.
      IF sy-subrc NE 0.
        CLEAR w_likp.
      ENDIF.
    ENDAT.

    w_lips-lfdat = w_likp-lfdat.

    w_lips-wadat_ist = w_likp-wadat_ist.

    MODIFY lt_lips FROM w_lips INDEX w_index
      TRANSPORTING
        lfdat
        wadat_ist.

  ENDLOOP.

ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2007 21:32:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/3021219#M714267</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-14T21:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: Select performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/3021220#M714268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Select Statements    contd&amp;#133;For All Entries&amp;lt;/b&amp;gt;&amp;#149;	The for all entries creates a where clause, where all the entries in the driver table are combined with OR. If the number of entries in the driver table is larger than rsdb/max_blocking_factor, several similar SQL statements are executed to limit the length of the WHERE clause. &lt;/P&gt;&lt;P&gt;	The plus &lt;/P&gt;&lt;P&gt;&amp;#149;	Large amount of data &lt;/P&gt;&lt;P&gt;&amp;#149;	Mixing processing and reading of data &lt;/P&gt;&lt;P&gt;&amp;#149;	Fast internal reprocessing of data &lt;/P&gt;&lt;P&gt;&amp;#149;	Fast &lt;/P&gt;&lt;P&gt;	The Minus &lt;/P&gt;&lt;P&gt;&amp;#149;	Difficult to program/understand &lt;/P&gt;&lt;P&gt;&amp;#149;	Memory could be critical (use FREE or PACKAGE size) &lt;/P&gt;&lt;P&gt;	&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;Points to be must considered FOR ALL ENTRIES&amp;lt;/u&amp;gt; &amp;#149;	Check that data is present in the driver table&lt;/P&gt;&lt;P&gt;&amp;#149;	Sorting the driver table &lt;/P&gt;&lt;P&gt;&amp;#149;	Removing duplicates from the driver table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;Consider the following piece of extract&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt; Loop at int_cntry.&lt;/P&gt;&lt;P&gt;       Select single * from zfligh into int_fligh&lt;/P&gt;&lt;P&gt; where cntry = int_cntry-cntry.&lt;/P&gt;&lt;P&gt; Append int_fligh. &lt;/P&gt;&lt;P&gt; Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above mentioned can be more optimized by using the following code.&lt;/P&gt;&lt;P&gt;Sort int_cntry by cntry.&lt;/P&gt;&lt;P&gt;Delete adjacent duplicates from int_cntry.&lt;/P&gt;&lt;P&gt;If NOT int_cntry[] is INITIAL.&lt;/P&gt;&lt;P&gt;            Select * from zfligh appending table int_fligh&lt;/P&gt;&lt;P&gt;            For all entries in int_cntry &lt;/P&gt;&lt;P&gt;            Where cntry = int_cntry-cntry.&lt;/P&gt;&lt;P&gt;Endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2007 07:59:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/3021220#M714268</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-15T07:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: Select performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/3021221#M714269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I created a new index in LIPS and now the performance is better.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2007 08:42:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/3021221#M714269</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-15T08:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: Select performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/3021222#M714270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry i didn't flag my message as question while creating . How can i reward your answer ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2007 08:52:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/3021222#M714270</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-15T08:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: Select performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/3021223#M714271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sure - the performance of your single SELECT statement is better, but the creation of the new index will have a negative impact every time a new delivery is created. The new index will now have to be kept upd to date as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's better to find a programming solution, let the users run the program in the background or live with slow performance on this single program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2007 14:19:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-performance/m-p/3021223#M714271</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-15T14:19:08Z</dc:date>
    </item>
  </channel>
</rss>

