<?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: Performance while using Select query. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-while-using-select-query/m-p/5610397#M1278432</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;First select the data into some internal table based on some conditions if any, and only for those entries in the internal table, using the addition FOR ALL ENTRIES, now fetch the data from the dependeny tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perormance wise it will be good if you use inner join some times it will fetch unwant data also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Munibabu.K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 May 2009 04:49:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-25T04:49:36Z</dc:date>
    <item>
      <title>Performance while using Select query.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-while-using-select-query/m-p/5610391#M1278426</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;If we use a select query with sub-queries to acces some records of two or tables using inner join or outer join.&lt;/P&gt;&lt;P&gt;Then is it good to access data using these select query for each user parameter from the database or should we copy the data to an inetrnal table...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And can we use join and where conditions simultaneously.&lt;/P&gt;&lt;P&gt;Please comment on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank u.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2009 06:52:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-while-using-select-query/m-p/5610391#M1278426</guid>
      <dc:creator>former_member130219</dc:creator>
      <dc:date>2009-05-22T06:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Performance while using Select query.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-while-using-select-query/m-p/5610392#M1278427</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;It is recommended that, if your requirement is fulfilled by below process, use it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First select the data into some internal table based on some conditions if any, and only for those entries in the internal table, using the addition FOR ALL ENTRIES, now fetch the data from the dependeny tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do the required processing on the internal tables.&lt;/P&gt;&lt;P&gt;Use READ on the internal tables for maximum number of times rather than selecting the data multiple times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santhosh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2009 07:01:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-while-using-select-query/m-p/5610392#M1278427</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-22T07:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: Performance while using Select query.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-while-using-select-query/m-p/5610393#M1278428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;please avoid using the inner join on the select query ,&lt;/P&gt;&lt;P&gt;it will be better if you  use  saperate  select query for the diffrent table . With data &lt;/P&gt;&lt;P&gt;from one  standard  table in internal table.&lt;/P&gt;&lt;P&gt;It will in prove  your performance. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try   following  ways to improve the performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Use package  size in the select query if data fetched is too big.&lt;/P&gt;&lt;P&gt;2) Use open curser and close curser.&lt;/P&gt;&lt;P&gt;3) Try to hit the index maintained for the standard table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hpe this will help &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards &lt;/P&gt;&lt;P&gt;Prashant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2009 07:04:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-while-using-select-query/m-p/5610393#M1278428</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-22T07:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Performance while using Select query.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-while-using-select-query/m-p/5610394#M1278429</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;&lt;/P&gt;&lt;P&gt;Instead of joins use the for all entries option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for eg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select matnr, mtart&lt;/P&gt;&lt;P&gt; into table imara&lt;/P&gt;&lt;P&gt;from mara&lt;/P&gt;&lt;P&gt;where matnr in s_matnr (select-option)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select matnr labst&lt;/P&gt;&lt;P&gt;into table imard&lt;/P&gt;&lt;P&gt;from mard&lt;/P&gt;&lt;P&gt;for all entres in table imara&lt;/P&gt;&lt;P&gt;where matnr = imara-matnr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp;Regards,&lt;/P&gt;&lt;P&gt;Kimaya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2009 07:08:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-while-using-select-query/m-p/5610394#M1278429</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-22T07:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: Performance while using Select query.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-while-using-select-query/m-p/5610395#M1278430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Try this , here performance has been improved to  very high extent&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT kokrs     "Controlling Area&lt;/P&gt;&lt;P&gt;         belnr     "Document Number&lt;/P&gt;&lt;P&gt;         refbz     "Posting row of reference document&lt;/P&gt;&lt;P&gt;         bukrs     "Company Cod&lt;/P&gt;&lt;P&gt;         owaer     "Currency Key&lt;/P&gt;&lt;P&gt;         objnr     "Object number&lt;/P&gt;&lt;P&gt;         kstar     "Cost element&lt;/P&gt;&lt;P&gt;         buzei     "Posting row&lt;/P&gt;&lt;P&gt;  INTO TABLE t_coep&lt;/P&gt;&lt;P&gt;         FROM coep&lt;/P&gt;&lt;P&gt;   WHERE objnr IN lr_objnr AND&lt;/P&gt;&lt;P&gt;         kstar  IN lr_kstar AND&lt;/P&gt;&lt;P&gt;         gjahr  IN s_gjahr AND&lt;/P&gt;&lt;P&gt;    %_HINTS ORACLE'INDEX ("&amp;amp;TABLE&amp;amp;" "COEP~2")'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Oracle hints is use to explictly hit the index&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***filtering the data based on the selection screen&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;company code, cost element.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;  LOOP AT t_coep WHERE&lt;/P&gt;&lt;P&gt;                 NOT bukrs IN p_bukrs OR&lt;/P&gt;&lt;P&gt;                 kokrs &amp;lt;&amp;gt; p_kokrs OR&lt;/P&gt;&lt;P&gt;                 NOT kstar  IN lr_kstar.&lt;/P&gt;&lt;P&gt;    DELETE t_coep.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF NOT t_coep[] IS INITIAL.&lt;/P&gt;&lt;P&gt;***Fetch data from CO Object: Document header based&lt;/P&gt;&lt;P&gt;***on all the relevant conditions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT   kokrs          "Controlling Area&lt;/P&gt;&lt;P&gt;             belnr          "Document Number&lt;/P&gt;&lt;P&gt;             refbn          "Reference Document Number&lt;/P&gt;&lt;P&gt;             refgj          "Fiscal year of reference document&lt;/P&gt;&lt;P&gt;             refbk          "Company code of FI document&lt;/P&gt;&lt;P&gt;             bltxt          "Doc.header text&lt;/P&gt;&lt;P&gt;             awtyp          "Reference procedure&lt;/P&gt;&lt;P&gt;             aworg AS awkey "Reference organisational units&lt;/P&gt;&lt;P&gt;             awsys          "Logical system of source document&lt;/P&gt;&lt;P&gt;        INTO TABLE t_cobk&lt;/P&gt;&lt;P&gt;        FROM cobk&lt;/P&gt;&lt;P&gt;        FOR ALL ENTRIES IN t_coep&lt;/P&gt;&lt;P&gt;       WHERE kokrs  = t_coep-kokrs      " controlling area&lt;/P&gt;&lt;P&gt;        AND  belnr  = t_coep-belnr .     " acc. document&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;filtering the data based on the selection screen.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;    LOOP AT t_cobk .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         IF    NOT  t_cobk-refbt  = c_acc_doc&lt;/P&gt;&lt;P&gt;            OR NOT  t_cobk-gjahr IN s_gjahr&lt;/P&gt;&lt;P&gt;            OR NOT  t_cobk-refbn IN lr_refbn&lt;/P&gt;&lt;P&gt;            OR NOT  t_cobk-perab IN s_monat.&lt;/P&gt;&lt;P&gt;        DELETE t_cobk.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this will help &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards &lt;/P&gt;&lt;P&gt;Prashant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2009 07:13:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-while-using-select-query/m-p/5610395#M1278430</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-22T07:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: Performance while using Select query.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-while-using-select-query/m-p/5610396#M1278431</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 a Thumb rule whenever there is  minimal optimal  no of database fetches then that is the desired phenomenon  in any database fetch situation  thus an &lt;STRONG&gt;2 stage  internal table phenomenon is always better than a  one step complex select query .&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;More over from a programatical stand point it is also desirable to do so becoz  we would be able to identify the exact process of fetch if an internal table is initialized and updated at one step level instead of a complicated fetch and join operation which is generally not considered effecient using   and also the order of  data retrival is not very transparent when debugged becoz only the final fetch result of the sellect query will be reflecting in the internal table . -- &lt;STRONG&gt;In other words your process is transparent&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 May 2009 19:00:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-while-using-select-query/m-p/5610396#M1278431</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-23T19:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: Performance while using Select query.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-while-using-select-query/m-p/5610397#M1278432</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;First select the data into some internal table based on some conditions if any, and only for those entries in the internal table, using the addition FOR ALL ENTRIES, now fetch the data from the dependeny tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perormance wise it will be good if you use inner join some times it will fetch unwant data also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Munibabu.K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 May 2009 04:49:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-while-using-select-query/m-p/5610397#M1278432</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-25T04:49:36Z</dc:date>
    </item>
  </channel>
</rss>

