<?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 stmt issue, performance tuning. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt-issue-performance-tuning/m-p/2067627#M427968</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;They are suggesting to use ranges rather than For all entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the query:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT b~kunnr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         b~zz_echan_reg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         a~title&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         a~first_name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         a~last_name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         a~email_addr INTO TABLE gt_ecustomers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                      FROM zyd_contacts AS a&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                     INNER JOIN kna1 AS b&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                        ON a&lt;SUB&gt;yd_kunnr = b&lt;/SUB&gt;kunnr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                     WHERE zz_echan_reg EQ 'X' OR zz_echan_reg EQ 'A'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                       AND zzcap_divert EQ space&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                       AND email_addr   NE space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check this out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for any help in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Mar 2007 11:07:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-28T11:07:31Z</dc:date>
    <item>
      <title>Select stmt issue, performance tuning.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt-issue-performance-tuning/m-p/2067624#M427965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Group,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a select stmt which is using inner join, and its taking good amoutn of time to get executed. I was told to tune the performance of that query. And my TL suggested me to use ranges in that select stmt, like the sign, option, low, high.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please help me out on this issue? Urgent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;P. Varun Kumar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2007 10:53:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt-issue-performance-tuning/m-p/2067624#M427965</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-28T10:53:22Z</dc:date>
    </item>
    <item>
      <title>Re: Select stmt issue, performance tuning.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt-issue-performance-tuning/m-p/2067625#M427966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If possible try replace the inner join with For all entries.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2007 10:58:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt-issue-performance-tuning/m-p/2067625#M427966</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-28T10:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Select stmt issue, performance tuning.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt-issue-performance-tuning/m-p/2067626#M427967</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;paste the part of the code that you want to tune for performance..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that will help us understand better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Aparna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2007 11:00:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt-issue-performance-tuning/m-p/2067626#M427967</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-28T11:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Select stmt issue, performance tuning.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt-issue-performance-tuning/m-p/2067627#M427968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;They are suggesting to use ranges rather than For all entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the query:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT b~kunnr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         b~zz_echan_reg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         a~title&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         a~first_name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         a~last_name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         a~email_addr INTO TABLE gt_ecustomers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                      FROM zyd_contacts AS a&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                     INNER JOIN kna1 AS b&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                        ON a&lt;SUB&gt;yd_kunnr = b&lt;/SUB&gt;kunnr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                     WHERE zz_echan_reg EQ 'X' OR zz_echan_reg EQ 'A'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                       AND zzcap_divert EQ space&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                       AND email_addr   NE space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check this out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for any help in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2007 11:07:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt-issue-performance-tuning/m-p/2067627#M427968</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-28T11:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: Select stmt issue, performance tuning.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt-issue-performance-tuning/m-p/2067628#M427969</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;write 2 seperate selects. use FOR ALL ENTRIES.before using for all entries delete the duplicate entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then remove NE in Where clause of the select statement. instead delete the unwanted entries after your select.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**reward if helpful&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;madhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2007 11:29:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt-issue-performance-tuning/m-p/2067628#M427969</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-28T11:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: Select stmt issue, performance tuning.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt-issue-performance-tuning/m-p/2067629#M427970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Vaurn,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Avoid using joins and use FOR ALL ENTRIES statement ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2007 11:33:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt-issue-performance-tuning/m-p/2067629#M427970</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-28T11:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: Select stmt issue, performance tuning.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt-issue-performance-tuning/m-p/2067630#M427971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. If your TL talked about ranges, this how you have to use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declare ranges:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ranges: r1 for kna1-zz_echan_reg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fill the ranges:&lt;/P&gt;&lt;P&gt;r1-sign = 'I'.&lt;/P&gt;&lt;P&gt;r1-option = 'EQ'.&lt;/P&gt;&lt;P&gt;r1-low    = 'X'&lt;/P&gt;&lt;P&gt;append r1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;r1-sign = 'I'.&lt;/P&gt;&lt;P&gt;r1-option = 'EQ'.&lt;/P&gt;&lt;P&gt;r1-low    = 'A'&lt;/P&gt;&lt;P&gt;append r1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this ranges you use in where condition of the select statement&lt;/P&gt;&lt;P&gt;as WHERE zz_echan_reg in r1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Avoid using joins and use for all entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. in the where condition remove email_addr NE space.&lt;/P&gt;&lt;P&gt;after you get the data into internal table you delete the unwanted entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Mar 2007 11:49:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt-issue-performance-tuning/m-p/2067630#M427971</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-29T11:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: Select stmt issue, performance tuning.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt-issue-performance-tuning/m-p/2067631#M427972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Group,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have to only tune this select query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT vbeln&lt;/P&gt;&lt;P&gt;            posnr&lt;/P&gt;&lt;P&gt;            matnr&lt;/P&gt;&lt;P&gt;            matkl&lt;/P&gt;&lt;P&gt;            zzact_start_date&lt;/P&gt;&lt;P&gt;            zzad_line_status&lt;/P&gt;&lt;P&gt;            zznm_pre_date&lt;/P&gt;&lt;P&gt;            INTO TABLE gt_vbap&lt;/P&gt;&lt;P&gt;            FROM vbap&lt;/P&gt;&lt;P&gt;            WHERE ( ( zzact_start_date = p_datum&lt;/P&gt;&lt;P&gt;            AND zzad_line_status = c_processed )&lt;/P&gt;&lt;P&gt;            OR zzact_start_date = p_datum ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest thank you in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Mar 2007 11:58:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt-issue-performance-tuning/m-p/2067631#M427972</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-29T11:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: Select stmt issue, performance tuning.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt-issue-performance-tuning/m-p/2067632#M427973</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;this select is not using the primary keys.try to add primary keys in your WHERE clauseor  try creating an index so that the select will be faster.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;madhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Mar 2007 12:22:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt-issue-performance-tuning/m-p/2067632#M427973</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-29T12:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Select stmt issue, performance tuning.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt-issue-performance-tuning/m-p/2067633#M427974</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;check for any existing view on the tables. If exists, write select stm on that view. If not exists use for all entries along with the ranges&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2007 11:11:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt-issue-performance-tuning/m-p/2067633#M427974</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-02T11:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: Select stmt issue, performance tuning.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt-issue-performance-tuning/m-p/2067634#M427975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your first query, you should change the conditions on ZZ_ECHAN_REG to:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; WHERE ZZ_ECHAN_REG  IN  ('A', 'X')&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This will remove the OR and the time to build the range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For your second Select look carefully at your conditions. As "zzact_start_date = p_datum" will get all the records in "zzact_start_date = p_datum&lt;/P&gt;&lt;P&gt;AND zzad_line_status = c_processed" and more.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MattG.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2007 12:44:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt-issue-performance-tuning/m-p/2067634#M427975</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-02T12:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: Select stmt issue, performance tuning.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt-issue-performance-tuning/m-p/2067635#M427976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Varun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider creating a secondary index on field zzact_start_date and break your sql statement into two statements:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT vbeln&lt;/P&gt;&lt;P&gt;posnr&lt;/P&gt;&lt;P&gt;matnr&lt;/P&gt;&lt;P&gt;matkl&lt;/P&gt;&lt;P&gt;zzact_start_date&lt;/P&gt;&lt;P&gt;zzad_line_status&lt;/P&gt;&lt;P&gt;zznm_pre_date&lt;/P&gt;&lt;P&gt;INTO TABLE gt_vbap&lt;/P&gt;&lt;P&gt;FROM vbap&lt;/P&gt;&lt;P&gt;WHERE zzact_start_date = p_datum&lt;/P&gt;&lt;P&gt;AND zzad_line_status = c_processed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Select using 'Appending table' statement&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT vbeln&lt;/P&gt;&lt;P&gt;posnr&lt;/P&gt;&lt;P&gt;matnr&lt;/P&gt;&lt;P&gt;matkl&lt;/P&gt;&lt;P&gt;zzact_start_date&lt;/P&gt;&lt;P&gt;zzad_line_status&lt;/P&gt;&lt;P&gt;zznm_pre_date&lt;/P&gt;&lt;P&gt;APPENDING TABLE gt_vbap&lt;/P&gt;&lt;P&gt;FROM vbap&lt;/P&gt;&lt;P&gt;WHERE zzact_start_date = p_datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete adjacent duplicates from gt_vbap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shyam Khemani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Apr 2007 16:32:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt-issue-performance-tuning/m-p/2067635#M427976</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-03T16:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: Select stmt issue, performance tuning.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt-issue-performance-tuning/m-p/2067636#M427977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all people. Keep up the good work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;God Bless.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2007 11:02:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-stmt-issue-performance-tuning/m-p/2067636#M427977</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-05T11:02:53Z</dc:date>
    </item>
  </channel>
</rss>

