<?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: Issue with select statement which is not using index in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-statement-which-is-not-using-index/m-p/4863206#M1137125</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;     Remember when ever using for all entries, &lt;/P&gt;&lt;P&gt;&amp;gt; always select the key fields when selecting using for all entries.&lt;/P&gt;&lt;P&gt;&amp;gt; eg:&lt;/P&gt;&lt;P&gt;&amp;gt; select key1 key2 .....keyn&lt;/P&gt;&lt;P&gt;&amp;gt; Krishna...&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does modifying the select clause influences the optimizer in the evaluation of the access path?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Dec 2008 07:14:54 GMT</pubDate>
    <dc:creator>rainer_hbenthal</dc:creator>
    <dc:date>2008-12-03T07:14:54Z</dc:date>
    <item>
      <title>Issue with select statement which is not using index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-statement-which-is-not-using-index/m-p/4863203#M1137122</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;SELECT vgbel&lt;/P&gt;&lt;P&gt;           FROM vbak INTO TABLE t_order&lt;/P&gt;&lt;P&gt;           FOR ALL ENTRIES IN t_contract&lt;/P&gt;&lt;P&gt;           WHERE auart IN r_odrtyp&lt;/P&gt;&lt;P&gt;           AND vgbel = t_contract-vbelv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above select statement is causing a performance issue because it is not using an index.If the index VBAK-AUD which is having AUDAT field is used in the where condition of the select statement the performance can be improve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it feasible to use audat field in the where condition?By using this field in the where condition will filter the entries from vbak table still further?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 06:02:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-statement-which-is-not-using-index/m-p/4863203#M1137122</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-03T06:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with select statement which is not using index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-statement-which-is-not-using-index/m-p/4863204#M1137123</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;    Remember when ever using for all entries, &lt;/P&gt;&lt;P&gt;always select the key fields when selecting using for all entries.&lt;/P&gt;&lt;P&gt;eg:&lt;/P&gt;&lt;P&gt;select key1 key2 .....keyn&lt;/P&gt;&lt;P&gt;from vbak into it_vbak&lt;/P&gt;&lt;P&gt;for all entries in it_vbap&lt;/P&gt;&lt;P&gt;where conditions...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Krishna...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 06:26:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-statement-which-is-not-using-index/m-p/4863204#M1137123</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-03T06:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with select statement which is not using index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-statement-which-is-not-using-index/m-p/4863205#M1137124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Create your own index for table VBAK in transaction SE11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Hans&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 06:44:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-statement-which-is-not-using-index/m-p/4863205#M1137124</guid>
      <dc:creator>h_senden2</dc:creator>
      <dc:date>2008-12-03T06:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with select statement which is not using index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-statement-which-is-not-using-index/m-p/4863206#M1137125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;     Remember when ever using for all entries, &lt;/P&gt;&lt;P&gt;&amp;gt; always select the key fields when selecting using for all entries.&lt;/P&gt;&lt;P&gt;&amp;gt; eg:&lt;/P&gt;&lt;P&gt;&amp;gt; select key1 key2 .....keyn&lt;/P&gt;&lt;P&gt;&amp;gt; Krishna...&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does modifying the select clause influences the optimizer in the evaluation of the access path?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 07:14:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-statement-which-is-not-using-index/m-p/4863206#M1137125</guid>
      <dc:creator>rainer_hbenthal</dc:creator>
      <dc:date>2008-12-03T07:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with select statement which is not using index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-statement-which-is-not-using-index/m-p/4863207#M1137126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try using table VBFA, it stores the link of predecessor and successor document that you seem to be looking for here.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2008 08:56:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-statement-which-is-not-using-index/m-p/4863207#M1137126</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-12-03T08:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with select statement which is not using index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-statement-which-is-not-using-index/m-p/4863208#M1137127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Hi,&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; SELECT vgbel&lt;/P&gt;&lt;P&gt;&amp;gt;            FROM vbak INTO TABLE t_order&lt;/P&gt;&lt;P&gt;&amp;gt;            FOR ALL ENTRIES IN t_contract&lt;/P&gt;&lt;P&gt;&amp;gt;            WHERE auart IN r_odrtyp&lt;/P&gt;&lt;P&gt;&amp;gt;            AND vgbel = t_contract-vbelv.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; The above select statement is causing a performance issue because it is not using an index.If the index VBAK-AUD which is having AUDAT field is used in the where condition of the select statement the performance can be improve.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Is it feasible to use audat field in the where condition?By using this field in the where condition will filter the entries from vbak table still further?&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;why do you think it should use an index?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you retrieve a  significant fraction of the table rows it might skip single index lookups in favour for a full index or table scan.&lt;/P&gt;&lt;P&gt;An ST05 trace / execution plan could help: &lt;A class="jive_macro jive_macro_blogpost" href="https://community.sap.com/" __jive_macro_name="blogpost" modifiedtitle="true" __default_attr="44587"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the FAE entries construct you step into problems when t_contract contains a lot of entries - especially &lt;/P&gt;&lt;P&gt;if no index is used: &lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="6629154"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;bye&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2008 08:36:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-statement-which-is-not-using-index/m-p/4863208#M1137127</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-04T08:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with select statement which is not using index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-statement-which-is-not-using-index/m-p/4863209#M1137128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yukon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the select statement uses any index from vbak table,then in that case can we use FAE even if the for all entries internal table is having many records?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2008 11:46:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-statement-which-is-not-using-index/m-p/4863209#M1137128</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-04T11:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with select statement which is not using index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-statement-which-is-not-using-index/m-p/4863210#M1137129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;An Index will be of use if you retrieve a small set of rows (~ 2 - 5%)  AND if the field(s) in your SELECT list are part of  the index key. In that case we avoid  an additonal  lookup in the table to get the non-index fields data. It would make the FAE part more acceptable if it had many entries. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem with FAE is that if you don't have an appropriate index it will full scan your table&lt;/P&gt;&lt;P&gt;several times because the internal FAE processing will transform your single SQL in several statements wich combine the fields with OR's wich inturn make it harder to get an efficient SQL execution plan.&lt;/P&gt;&lt;P&gt;It's really important to keep the entries small in FAE!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For this reason FAE can never be a replacement for a Join operation if you deal with big tables&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Therefor I prefer joins if applicable, because IF things go worse you scan the table only once, and if an index would be supported it would also be faster because you run only 1 statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would encourage you to use ST05 to trace your SQL and you will see HOW FAE is translated to several statements  send to the database- it's an eye opener behind the scenes of OPEN SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;bye&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2008 13:26:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-select-statement-which-is-not-using-index/m-p/4863210#M1137129</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-04T13:26:24Z</dc:date>
    </item>
  </channel>
</rss>

