<?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: %_hints does not works in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/hints-does-not-works/m-p/9144219#M1709812</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;no, in your second case the hint does not work, merly the optimizer just accidently works as you expect &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;no, in a select without a join, no table-alias is used in the statement, and the tablename will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a join, the tablenames get aliases in the statement sent to the DB. When a table gets aliases in the statement, I had it very frequently, that the hint is not taken when using the table name.&lt;/P&gt;&lt;P&gt;You need to specify the alias, which will be i.e. T_00 or T_01. Might be T1 or T2 as well.&lt;/P&gt;&lt;P&gt;You need to find out in the SQL trace to see what will be parsed.&lt;/P&gt;&lt;P&gt;It might even be that ABAP is using your aliases ("a" and "b"), but you need to find out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So check what alias the DFKKOP table is getting in the real execution and adjust the hint:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%_hints oracle 'index (T_00 "DFKKOP~4")'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will work for you as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But: did you verify that index Z01 is really slower? As far as the fields used in WHERE concerned, Z01 should perform better because it should be physically smaller. Since both fields are EQ specified, both indexes should work well, but Z01 should have a better re-use ratio for already read blocks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Volker&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Volker Borowski&#xD;
&#xD;
Adjusted, after re-read: compared plan was without join&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 08 Dec 2012 08:11:52 GMT</pubDate>
    <dc:creator>volker_borowski2</dc:creator>
    <dc:date>2012-12-08T08:11:52Z</dc:date>
    <item>
      <title>%_hints does not works</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hints-does-not-works/m-p/9144216#M1709809</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;&lt;/P&gt;&lt;P&gt;Could you help to debug this instruction and explain why index DFKKOP~4 is not used :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT a~vkont a~opbel a~opupw a~opupk a~opupz a~augst a~hvorg a~tvorg a~waers a~faedn a~betrw a~xblnr a~vtref a~applk a~bldat a~blart a~stakz a~xanza a~whgrp a~abwtp a~augrs a~grkey b~cpudt b~cputm&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;INTO TABLE it_dfkkop&lt;/P&gt;&lt;P&gt;FROM dfkkop AS a INNER JOIN dfkkko AS b ON a~opbel = b~opbel FOR ALL ENTRIES IN f_it_vkont &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE vkont EQ f_it_vkont-vkont AND augst EQ space&lt;/P&gt;&lt;P&gt;%_hints oracle 'index ("DFKKOP","DFKKOP~4")'.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is DFKKOP~Z01 which is used (in trace st04)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Index DFKKOP~4 is :&lt;/P&gt;&lt;P&gt;MANDT&lt;/P&gt;&lt;P&gt;AUGST&lt;/P&gt;&lt;P&gt;VKONT&lt;/P&gt;&lt;P&gt;BUKRS&lt;/P&gt;&lt;P&gt;AUGDT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Index DFKKOP~Z01 is :&lt;/P&gt;&lt;P&gt;MANDT&lt;/P&gt;&lt;P&gt;VKONT&lt;/P&gt;&lt;P&gt;AUGST&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your help...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mathieu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2012 20:58:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hints-does-not-works/m-p/9144216#M1709809</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-12-07T20:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: %_hints does not works</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hints-does-not-works/m-p/9144217#M1709810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmm, try replacing the comma between table and index name with space. If this does not work, we'll have to look further.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2012 21:03:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hints-does-not-works/m-p/9144217#M1709810</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2012-12-07T21:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: %_hints does not works</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hints-does-not-works/m-p/9144218#M1709811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We try with space but it doesn't works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Moreover, with a unique selection (without inner join) HINTS instruction works correctly : Index DFKKOP~4 is used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;Mathieu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2012 22:27:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hints-does-not-works/m-p/9144218#M1709811</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-12-07T22:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: %_hints does not works</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hints-does-not-works/m-p/9144219#M1709812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;no, in your second case the hint does not work, merly the optimizer just accidently works as you expect &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;no, in a select without a join, no table-alias is used in the statement, and the tablename will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a join, the tablenames get aliases in the statement sent to the DB. When a table gets aliases in the statement, I had it very frequently, that the hint is not taken when using the table name.&lt;/P&gt;&lt;P&gt;You need to specify the alias, which will be i.e. T_00 or T_01. Might be T1 or T2 as well.&lt;/P&gt;&lt;P&gt;You need to find out in the SQL trace to see what will be parsed.&lt;/P&gt;&lt;P&gt;It might even be that ABAP is using your aliases ("a" and "b"), but you need to find out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So check what alias the DFKKOP table is getting in the real execution and adjust the hint:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%_hints oracle 'index (T_00 "DFKKOP~4")'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will work for you as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But: did you verify that index Z01 is really slower? As far as the fields used in WHERE concerned, Z01 should perform better because it should be physically smaller. Since both fields are EQ specified, both indexes should work well, but Z01 should have a better re-use ratio for already read blocks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Volker&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Volker Borowski&#xD;
&#xD;
Adjusted, after re-read: compared plan was without join&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Dec 2012 08:11:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hints-does-not-works/m-p/9144219#M1709812</guid>
      <dc:creator>volker_borowski2</dc:creator>
      <dc:date>2012-12-08T08:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: %_hints does not works</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hints-does-not-works/m-p/9144220#M1709813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the order in which you have defined secondary index in 04 is augst and vkont where as in where query the order is different ..... can you check by reversing the order in where query ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Dec 2012 09:08:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hints-does-not-works/m-p/9144220#M1709813</guid>
      <dc:creator>former_member193464</dc:creator>
      <dc:date>2012-12-08T09:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: %_hints does not works</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hints-does-not-works/m-p/9144221#M1709814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;your query is pretty complex using join with for all entries.&lt;/P&gt;&lt;P&gt;Since you are using secondary index, i am guessing performance is poor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would suggest to split the join into a 'For all entries(FAE)'.&lt;/P&gt;&lt;P&gt;FAE is generally faster compared to join.&lt;/P&gt;&lt;P&gt;You have to use FAE on both the tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you give the number of records which are being fetched by your query?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2012 12:03:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hints-does-not-works/m-p/9144221#M1709814</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-12-10T12:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: %_hints does not works</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hints-does-not-works/m-p/9144222#M1709815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With %_HINTS ORACLE 'index (T_00, "DFKKOP~4")' it works !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mathieu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2012 15:09:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hints-does-not-works/m-p/9144222#M1709815</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-12-10T15:09:21Z</dc:date>
    </item>
  </channel>
</rss>

