<?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: %_HINT in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646600#M1284975</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I must say I find this discussion useless, please explain, how you would fill the dynamic hint variable.&lt;/P&gt;&lt;P&gt;In theory it can be possible, and practise if is probably very rare.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would to see the logic which fills lv_hint.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe somebody can propose the self-optizing SELECT statement. If performance is low it will generate a hint. if still low it tries another. Please provide decision logic &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 May 2009 11:11:29 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-20T11:11:29Z</dc:date>
    <item>
      <title>%_HINT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646591#M1284966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;is there a way to specify in Open-SQL hint to optimizer dynamically? I had in mind something like dynamic where clause.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2009 13:51:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646591#M1284966</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-19T13:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: %_HINT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646592#M1284967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, if you just leave out the hint, it will optimize dynamically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2009 14:02:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646592#M1284967</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-19T14:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: %_HINT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646593#M1284968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what should be the purpose of dynamic hint ?????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hints are for exceptions, only if the optimizer has problems, and these problems should be very specific.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dynamic where-clause is dynamic where-clause, read documentation&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2009 15:17:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646593#M1284968</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-19T15:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: %_HINT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646594#M1284969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can build your hint and put it into a variable. If the variable is initial the hint is not passed to the database engine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data:
  lv_hint type c length 30.

  lv_hint = 'index("&amp;amp;TABLE&amp;amp;")'. " Oracle hint

  SELECT *
  INTO TABLE lt_mara
  up to 10 rows
  FROM mara
  %_hints oracle lv_hint.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read SAP note 129385 about hints for your database type.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2009 18:51:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646594#M1284969</guid>
      <dc:creator>former_member207438</dc:creator>
      <dc:date>2009-05-19T18:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: %_HINT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646595#M1284970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;maybe I should be more specific. I'm working on some add on Croatia(Foreign Trade), and I'm selecting all kind of data from BSID, BSAD, BISK , BSAK well not always with key/index fields and therefore I figured out that in some cases optimizer uses default index, which is not the best. Local, on our development server, I tried in this case %_HINT ORACLE "FIRST_ROW" and performance is better, but what if some customer doesnt have Oracle? In this case I thought to replace specific DB hint with some string, and this string should be customer specific(set up through customizing).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 08:34:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646595#M1284970</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-20T08:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: %_HINT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646596#M1284971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mario,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can extend Edwards example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data:
  lv_hint type c length 30.
 

select hint into lv_hint
from cust_hint_table
...
 
  SELECT *
  INTO TABLE lt_mara
  up to 10 rows
  FROM mara
  %_hints oracle lv_hint
  %_hints db2 lv_hint
  %_hints db4 lv_hint
  %_hints db6 lv_hint
... .

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hermann&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 09:35:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646596#M1284971</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2009-05-20T09:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: %_HINT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646597#M1284972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ok, that is not to bad, but also not to elegant. is it possible also to generic specify for which DB id hint?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 10:36:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646597#M1284972</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-20T10:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: %_HINT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646598#M1284973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mario,&lt;/P&gt;&lt;P&gt;&lt;/P&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; ok, that is not to bad, but also not to elegant. &lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;true. &lt;/P&gt;&lt;P&gt;&lt;/P&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; is it possible also to generic specify for which DB id hint?&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 
data:
  lv_hint type c length 30.
 
 
select hint into lv_hint
from cust_hint_table
*where dbsys = sy-dbsys*
AND ...
...
 
  SELECT *
  INTO TABLE lt_mara
  up to 10 rows
  FROM mara
  %_hints oracle lv_hint
  %_hints db2 lv_hint
  %_hints db4 lv_hint
  %_hints db6 lv_hint
... .

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ADBC is completely native and dynamic (SQL in strings like JDBC)...&lt;/P&gt;&lt;P&gt;but i don't think that this is appropriate. I would stick with the OPEN SQL Hints.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hermann&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 10:49:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646598#M1284973</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2009-05-20T10:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: %_HINT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646599#M1284974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I thought on something like this, instead of&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  %_hints oracle lv_hint&lt;/P&gt;&lt;P&gt;  %_hints db2 lv_hint&lt;/P&gt;&lt;P&gt;  %_hints db4 lv_hint&lt;/P&gt;&lt;P&gt;  %_hints db6 lv_hint&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to use only one:&lt;/P&gt;&lt;P&gt;  %_hints lv_hint&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and system knows that is Oracle DB or DB2....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 10:54:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646599#M1284974</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-20T10:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: %_HINT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646600#M1284975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I must say I find this discussion useless, please explain, how you would fill the dynamic hint variable.&lt;/P&gt;&lt;P&gt;In theory it can be possible, and practise if is probably very rare.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would to see the logic which fills lv_hint.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe somebody can propose the self-optizing SELECT statement. If performance is low it will generate a hint. if still low it tries another. Please provide decision logic &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 11:11:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646600#M1284975</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-20T11:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: %_HINT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646601#M1284976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No Siegfried, self optimizing SELECT is not what I meant(Ich glaube, dass Sie nicht ein Zyniker tief in Seiner Seele sind). As this AddOn could be deployed to many different SAP systems with different DBs, I want to write only once per select %_HINT lv_hint. In lv_hint then would be db-string and optimizer hint. How could be this done, is pure programming logic which is not relevant.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 11:22:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646601#M1284976</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-20T11:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: %_HINT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646602#M1284977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mario - if you look for hints in SAP standard programs, I think you'll see that SAP uses sy-dbsys to determine the database and therefore the format of the hint to construct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 13:03:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646602#M1284977</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-20T13:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: %_HINT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646603#M1284978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; self optimizing SELECT is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;no, in fact it is not even impossible, that you trigger a hint, if the ST04 figures out, that a statement is slow. not done but not impossible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dynamic hint, still I would not recommend it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no 1:1 relation between the hints of the different databases, usually there is an index hint, but this is not always the first choice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And even the index hint needs table name, and index name. Better write it by hand.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would assume that most of your dynamic hints will simply not work, but the have one or the other bug and are simply ignored.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Overall, you should use hints carefully and only in exceptions, your idea is against this rule.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 13:42:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646603#M1284978</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-20T13:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: %_HINT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646604#M1284979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mario,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm afraid, that is not possible. You have to specify the hint for each database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even a DBI Hint uses the DB specific part infront because even the DBI hints&lt;/P&gt;&lt;P&gt;that don't go to the database can be database specific.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Back to your topic:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dynamic hints from customizing ...  We had a once a customer who build &lt;/P&gt;&lt;P&gt;a whole frame work (on one DB platform) wich dynamic hints from a customizing&lt;/P&gt;&lt;P&gt;table. With that he was able to quickly react on problem queries for example in case&lt;/P&gt;&lt;P&gt;of bugs without code changes (if the dynamic hint solution was implemented). &lt;/P&gt;&lt;P&gt;So the hints were "switchable" which actually was a nice thing. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've never seen it over database borders. And in general i would say it is for&lt;/P&gt;&lt;P&gt;sure no common practise. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you consider that more and more DB manufacturers offer solutions to&lt;/P&gt;&lt;P&gt;obtain a "execution plan stability" without changing the code ... your thoughts&lt;/P&gt;&lt;P&gt;are just going in the same direction ... on the ABAP side.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However i don't know if it would work over database  borders because the &lt;/P&gt;&lt;P&gt;possibilites with hints between the databases are VERY diverse. And there&lt;/P&gt;&lt;P&gt;is still lots and lots of undocumented stuff. So i don't know if it will turn out&lt;/P&gt;&lt;P&gt;to be sucessfull. For the customer i mentioned, within one database it turned&lt;/P&gt;&lt;P&gt;out to be sucessfull in terms of reacting quickly on problems without code or &lt;/P&gt;&lt;P&gt;configuration changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hermann&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 14:27:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646604#M1284979</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2009-05-20T14:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: %_HINT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646605#M1284980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ok, I will simply use code like Hermann Gahm said, with my own customizing in Z*table or z-program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thx all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;br&lt;/P&gt;&lt;P&gt;mario&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 15:15:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/hint/m-p/5646605#M1284980</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-20T15:15:16Z</dc:date>
    </item>
  </channel>
</rss>

