<?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 issue with table VBAK. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-table-vbak/m-p/7709636#M1578956</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's a bad SELECT statement; you can't expect that to be optimal when you have that many sales orgs and distinct date values and you aren't specifying any other field which might increase the selectivity or trigger another index to be picked up.  You need to reduce your selection to specific customers, PO values, materials, smaller date range or something and consider using one of the order index tables as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Feb 2011 14:56:37 GMT</pubDate>
    <dc:creator>brad_bohn</dc:creator>
    <dc:date>2011-02-18T14:56:37Z</dc:date>
    <item>
      <title>Performance issue with table VBAK.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-table-vbak/m-p/7709635#M1578955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SQL Statement&lt;/P&gt;&lt;P&gt;  SELECT&lt;/P&gt;&lt;P&gt;    "VBELN", "ERDAT", "ERZET", "AUART", "VKORG", "VTWEG", "VKBUR", "KNUMV",&lt;/P&gt;&lt;P&gt;    "VDATU", "BSTNK", "BSARK", "KUNNR"&lt;/P&gt;&lt;P&gt;  FROM&lt;/P&gt;&lt;P&gt;    "VBAK"&lt;/P&gt;&lt;P&gt;  WHERE&lt;/P&gt;&lt;P&gt;    "MANDT" = ? AND ( "ERDAT" = ? AND "ERZET" &amp;gt; ? OR "ERDAT" &amp;gt; ? ) AND "AUART"&lt;/P&gt;&lt;P&gt;    IN ( ?, ? ) AND "VKORG" IN ( ?, ?, ?, ?, ?, ?, ?, ? ) AND "VTWEG" IN ( ?,&lt;/P&gt;&lt;P&gt;    ?, ?, ?, ?, ?, ? ) AND "BSARK" = ?  WITH UR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Access Plan      Opt Level = 5 ; Parallelism = None&lt;/P&gt;&lt;P&gt;    0 SELECT STATEMENT ( Estimated Costs =  3,258E+07 [timerons] )&lt;/P&gt;&lt;P&gt;           1 RETURN&lt;/P&gt;&lt;P&gt;               2 NLJOIN&lt;/P&gt;&lt;P&gt;                   3 [O] TBSCAN&lt;/P&gt;&lt;P&gt;                       4 SORT&lt;/P&gt;&lt;P&gt;                           5 TBSCAN GENROW&lt;/P&gt;&lt;P&gt;                   6 &amp;lt;i&amp;gt; FETCH VBAK&lt;/P&gt;&lt;P&gt;                       7 IXSCAN VBAK~ZL1 #key columns:  2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Source Code : /AMS/OUSCSR_ORDER_EXCEP_FORM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT vbeln "Sales document no&lt;/P&gt;&lt;P&gt;*-Begin of Mod-013&lt;DEL&gt;&amp;gt;&amp;gt;&lt;/DEL&gt;&lt;/P&gt;&lt;P&gt;           erdat&lt;/P&gt;&lt;P&gt;           erzet&lt;/P&gt;&lt;P&gt;*-End of Mod-013&lt;DEL&gt;&amp;lt;&amp;lt;&lt;/DEL&gt;&lt;/P&gt;&lt;P&gt;           auart "Sales document type&lt;/P&gt;&lt;P&gt;           vkorg "sales org&lt;/P&gt;&lt;P&gt;           vtweg "dist chnl&lt;/P&gt;&lt;P&gt;           vkbur "Sales office&lt;/P&gt;&lt;P&gt;           knumv "No of document condition&lt;/P&gt;&lt;P&gt;           vdatu "Requested delivery date&lt;/P&gt;&lt;P&gt;           bstnk "Purchase order no&lt;/P&gt;&lt;P&gt;           bsark "Purchase order type&lt;/P&gt;&lt;P&gt;           kunnr "Sold to number&lt;/P&gt;&lt;P&gt;    INTO TABLE fp_i_vbak&lt;/P&gt;&lt;P&gt;    FROM vbak&lt;/P&gt;&lt;P&gt;    WHERE  vbeln IN s_vbeln&lt;/P&gt;&lt;P&gt;      AND  erdat GE v_start_date&lt;/P&gt;&lt;P&gt;      AND  auart IN s_ordty&lt;/P&gt;&lt;P&gt;      AND  vkorg IN s_salorg&lt;/P&gt;&lt;P&gt;      AND  vtweg IN s_discha&lt;/P&gt;&lt;P&gt;      AND  vkbur IN s_saloff&lt;/P&gt;&lt;P&gt;      AND  bsark IN s_purty&lt;/P&gt;&lt;P&gt;      AND  kunnr IN s_soldto .&lt;/P&gt;&lt;P&gt;*-Begin Of Mod-013&lt;DEL&gt;&amp;gt;&amp;gt;&lt;/DEL&gt;&lt;/P&gt;&lt;P&gt;    IF sy-subrc IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; AND erzet &amp;gt; v_start_time )&lt;/P&gt;&lt;P&gt;       OR  erdat &amp;gt; v_start_date )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      DELETE fp_i_vbak WHERE erdat LT v_start_date .&lt;/P&gt;&lt;P&gt;      DELETE fp_i_vbak WHERE erdat EQ v_start_date&lt;/P&gt;&lt;P&gt;                         AND erzet LT v_start_time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The index used is :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  6 &amp;lt;i&amp;gt; FETCH VBAK&lt;/P&gt;&lt;P&gt;         7 IXSCAN VBAK~ZL1 #key columns:  2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NONUNIQUE Index VBAK~ZL1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Column Name        # Distinct&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MANDT                       1&lt;/P&gt;&lt;P&gt;VKORG                     154&lt;/P&gt;&lt;P&gt;ERDAT                   2.312&lt;/P&gt;&lt;P&gt;BSTNK               8.529.428&lt;/P&gt;&lt;P&gt;KUNNR                 818.388&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please optimize the SQL. Only 2 key columns used  .. MANDT , VKORG. This is not optimal. The code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      AND  ( ( erdat = v_start_date AND erzet &amp;gt; v_start_time )&lt;/P&gt;&lt;P&gt;       OR  erdat &amp;gt; v_start_date )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;should be reviewed. This is confusing the DB2 optimizer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi All please look this issue any one suggest me where is problem with select querry and how improve performance of vbak select querry.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Feb 2011 10:04:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-table-vbak/m-p/7709635#M1578955</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-18T10:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue with table VBAK.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-table-vbak/m-p/7709636#M1578956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's a bad SELECT statement; you can't expect that to be optimal when you have that many sales orgs and distinct date values and you aren't specifying any other field which might increase the selectivity or trigger another index to be picked up.  You need to reduce your selection to specific customers, PO values, materials, smaller date range or something and consider using one of the order index tables as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Feb 2011 14:56:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-table-vbak/m-p/7709636#M1578956</guid>
      <dc:creator>brad_bohn</dc:creator>
      <dc:date>2011-02-18T14:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue with table VBAK.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-table-vbak/m-p/7709637#M1578957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree that this is not good select statement, but think it can be improved with some changes....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;suggestions:&lt;/P&gt;&lt;P&gt;1. remove all date fields from select statement&lt;/P&gt;&lt;P&gt;2. make a range for auart and vkorg&lt;/P&gt;&lt;P&gt;3. after select check the date condition and delete entries&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Feb 2011 19:34:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-table-vbak/m-p/7709637#M1578957</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-18T19:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue with table VBAK.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-table-vbak/m-p/7709638#M1578958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't see how replacing select-options with ranges is a performance boost?  Nor is removing date ranges unless there's no other way to stop a bad index from being selected.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Feb 2011 22:49:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-table-vbak/m-p/7709638#M1578958</guid>
      <dc:creator>brad_bohn</dc:creator>
      <dc:date>2011-02-18T22:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue with table VBAK.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-table-vbak/m-p/7709639#M1578959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Make sure you have an index that includes ERDAT and ERZET, since you're doing a comparison with it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Feb 2011 20:35:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-table-vbak/m-p/7709639#M1578959</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-25T20:35:53Z</dc:date>
    </item>
  </channel>
</rss>

