<?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: SQL- Performance With VBAP table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-performance-with-vbap-table/m-p/3547957#M853538</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;List of indexes on VBAP&lt;/P&gt;&lt;P&gt;index on MANDT OBJNR          &lt;/P&gt;&lt;P&gt;index on MANDT VPMAT &amp;amp; VPWRK  &lt;/P&gt;&lt;P&gt;Index on MATNR, ERDAT&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Mar 2008 20:51:22 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-17T20:51:22Z</dc:date>
    <item>
      <title>SQL- Performance With VBAP table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-performance-with-vbap-table/m-p/3547955#M853536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;I have a query on table VBAP which fetches data based on date-time stamp and few other fields. Date-tme fields are always filled. If no plant is additionally entered, query runs for about 20 minutes. However, when user enters a plant, query runs for ever (Last run took about 16 hours). I tried tweaking the "where clause" a bit with no sign of improved performance. I really don't understand why should plant mess with the index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your replies are appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Yogi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT b&lt;SUB&gt;vbeln b&lt;/SUB&gt;posnr b&lt;SUB&gt;uepos b&lt;/SUB&gt;matnr b&lt;SUB&gt;werks b&lt;/SUB&gt;meins b~objnr&lt;/P&gt;&lt;P&gt;               b&lt;SUB&gt;erdat c&lt;/SUB&gt;webaz c&lt;SUB&gt;plifz e&lt;/SUB&gt;fabkl e~pipatg&lt;/P&gt;&lt;P&gt;               INTO TABLE pt_order&lt;/P&gt;&lt;P&gt;              FROM vbak AS a &lt;/P&gt;&lt;P&gt;                            INNER JOIN vbap AS b&lt;/P&gt;&lt;P&gt;               ON a&lt;SUB&gt;vbeln = b&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;                            INNER JOIN marc AS c&lt;/P&gt;&lt;P&gt;               ON b&lt;SUB&gt;matnr = c&lt;/SUB&gt;matnr AND&lt;/P&gt;&lt;P&gt;                     b&lt;SUB&gt;werks = c&lt;/SUB&gt;werks&lt;/P&gt;&lt;P&gt;                            INNER JOIN vbuk AS d&lt;/P&gt;&lt;P&gt;               ON a&lt;SUB&gt;vbeln = d&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;                            INNER JOIN tvst AS e&lt;/P&gt;&lt;P&gt;               ON b&lt;SUB&gt;vstel = e&lt;/SUB&gt;vstel&lt;/P&gt;&lt;P&gt;       WHERE  a~vkorg IN s_vkorg&lt;/P&gt;&lt;P&gt;      AND  a~auart IN s_auart&lt;/P&gt;&lt;P&gt;      AND  ( ( ( b&lt;SUB&gt;erdat LT s_erdat-high ) OR ( b&lt;/SUB&gt;erdat EQ s_erdat-high&lt;/P&gt;&lt;P&gt;                                             AND b~erzet LE p_totim ) )&lt;/P&gt;&lt;P&gt;      AND  ( ( b&lt;SUB&gt;erdat GT s_erdat-low )   OR   ( b&lt;/SUB&gt;erdat EQ s_erdat-low&lt;/P&gt;&lt;P&gt;                                           AND b~erzet GE p_frtim ) ) )&lt;/P&gt;&lt;P&gt;         AND  b~werks IN s_werks     &lt;/P&gt;&lt;P&gt;         AND  b~abgru IN s_abgru      &lt;/P&gt;&lt;P&gt;         AND  c~mtvfp IN s_mtvfp&lt;/P&gt;&lt;P&gt;         AND  d~cmgst IN s_cmgst.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 19:48:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-performance-with-vbap-table/m-p/3547955#M853536</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T19:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: SQL- Performance With VBAP table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-performance-with-vbap-table/m-p/3547956#M853537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It would help if you could list the indexes and their fields for table VBAP in your system.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 20:12:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-performance-with-vbap-table/m-p/3547956#M853537</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T20:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: SQL- Performance With VBAP table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-performance-with-vbap-table/m-p/3547957#M853538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;List of indexes on VBAP&lt;/P&gt;&lt;P&gt;index on MANDT OBJNR          &lt;/P&gt;&lt;P&gt;index on MANDT VPMAT &amp;amp; VPWRK  &lt;/P&gt;&lt;P&gt;Index on MATNR, ERDAT&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 20:51:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-performance-with-vbap-table/m-p/3547957#M853538</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T20:51:22Z</dc:date>
    </item>
  </channel>
</rss>

