<?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: Problem with Index.. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-index/m-p/2396846#M533576</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;You can force the sql statement to use a particular index by using %_HINTS parameter. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For eg:&lt;/P&gt;&lt;P&gt;SELECT carrid connid cityfrom&lt;/P&gt;&lt;P&gt;FROM spfli INTO (xcarrid, xconnid, xcityfrom)&lt;/P&gt;&lt;P&gt;WHERE carrid = 'LH ' AND cityfrom = 'FRANKFURT'&lt;/P&gt;&lt;P&gt;%_HINTS ORACLE 'INDEX("SPFLI" "SPFLI~001")'.&lt;/P&gt;&lt;P&gt;WRITE: / xcarrid, xconnid, xcityfrom.&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here "001" is the index..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer to the SAP Note #129385 and related notes for further information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Simha.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward all the helpful asnwers..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Jun 2007 12:48:38 GMT</pubDate>
    <dc:creator>Simha_</dc:creator>
    <dc:date>2007-06-19T12:48:38Z</dc:date>
    <item>
      <title>Problem with Index..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-index/m-p/2396845#M533575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a secondary index in table MSEG with name "Z1".&lt;/P&gt;&lt;P&gt;Now when I am using the select statement&lt;/P&gt;&lt;P&gt;and specifying the index in it, still index "Z1" is not used.&lt;/P&gt;&lt;P&gt;It is still using the default index 'M'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i make it use the index "Z1" ??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2007 12:44:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-index/m-p/2396845#M533575</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-19T12:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Index..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-index/m-p/2396846#M533576</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;You can force the sql statement to use a particular index by using %_HINTS parameter. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For eg:&lt;/P&gt;&lt;P&gt;SELECT carrid connid cityfrom&lt;/P&gt;&lt;P&gt;FROM spfli INTO (xcarrid, xconnid, xcityfrom)&lt;/P&gt;&lt;P&gt;WHERE carrid = 'LH ' AND cityfrom = 'FRANKFURT'&lt;/P&gt;&lt;P&gt;%_HINTS ORACLE 'INDEX("SPFLI" "SPFLI~001")'.&lt;/P&gt;&lt;P&gt;WRITE: / xcarrid, xconnid, xcityfrom.&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here "001" is the index..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer to the SAP Note #129385 and related notes for further information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Simha.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward all the helpful asnwers..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2007 12:48:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-index/m-p/2396846#M533576</guid>
      <dc:creator>Simha_</dc:creator>
      <dc:date>2007-06-19T12:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Index..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-index/m-p/2396847#M533577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prem , &lt;/P&gt;&lt;P&gt;  In this case you will have to use Oracle Hints , what this basically does is it tells the system how the database query must be executed.&lt;/P&gt;&lt;P&gt;Here is a sample&lt;/P&gt;&lt;P&gt;         select matnr&lt;/P&gt;&lt;P&gt;         into table it_1&lt;/P&gt;&lt;P&gt;         from mara&lt;/P&gt;&lt;P&gt;         %_hints oracle&lt;/P&gt;&lt;P&gt;             'INDEX("MARA~L" )'.&lt;/P&gt;&lt;P&gt;Please check what is the database being used , if it is orcale then in your case the query will be &lt;/P&gt;&lt;P&gt;        select &amp;lt;fields&amp;gt;&lt;/P&gt;&lt;P&gt;         into table it_1&lt;/P&gt;&lt;P&gt;         from MSEG&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;         %_hints oracle&lt;/P&gt;&lt;P&gt;             'INDEX("MSEG~Z1" )'&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps , assign points if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2007 12:49:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-index/m-p/2396847#M533577</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-19T12:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Index..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-index/m-p/2396848#M533578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes i have used this select statement with %_HINTS ORACLE 'INDEX(MSEG"Z1")' and still it is not using the secondary index Z1..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2007 13:02:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-index/m-p/2396848#M533578</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-19T13:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Index..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-index/m-p/2396849#M533579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i have used %_HINTS ORACLE 'INDEX(MSEG"Z1")' but still it is not selecting the index Z1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2007 13:03:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-index/m-p/2396849#M533579</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-19T13:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Index..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-index/m-p/2396850#M533580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prem , &lt;/P&gt;&lt;P&gt;  Please check the format in which the command is to be written and try again , what you have written now is not correct.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2007 08:06:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-index/m-p/2396850#M533580</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-20T08:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Index..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-index/m-p/2396851#M533581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First it must be stated that table design is a more logical work while index design is rather technical. In table design it might make sense to place certain fields (client, company code, ...) in the beginning. In index design, this is not advisable. Very important for an index is that it contains very selective fields in the beginning. Those are fields like object numbers. Not selective are client, company code, ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Indexes should be small (few fields). The Database optimizer can combine two or more indexes to execute a query. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Indexes of one table should be disjoint (have few common fields), in order not to confuse the optimizer which index to use. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that each index slows the inserts into the table down. Updates are only slowed down if indexed fields are updated. In general, heavy inserted tables should have only few indexes while heavy selected tables might have more. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Primary index: the primary index contains key fiels of a table and a pointer to non-key fields of the table. The primary index is created automatically when a table is created in database and moreover you can further define reference to the primary index which are known as Secondary index. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;9 indexes can be created for a table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example for performance in the select query ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An index is defined on fields FIELD1, FIELD2, FIELD3 and FIELD4 of table BSPTAB in this order. This table is accessed with the SELECT statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM BSPTAB WHERE FIELD1 = X1 AND FIELD2 = X2 AND FIELD4= X4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since FIELD3 is not specified more exactly, only the index sorting up to FIELD2 is of any use. If the database system accesses the data using this index, it will quickly find all the records for which FIELD1 = X1 and FIELD2 = X2. You then have to select all the records for which FIELD4 = X4 from this set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to Check if an Index is Used &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Procedure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.Open a second session and choose System ® Utilities ® Performance trace.&lt;/P&gt;&lt;P&gt;The Trace Requests screen appears.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.Select Trace on. &lt;/P&gt;&lt;P&gt;The SQL trace is activated for your user, that is all the database operations under your user are recorded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.In the first window, perform the action in which the index should be used. &lt;/P&gt;&lt;P&gt;If your database system uses a cost-based optimizer, you should perform this action with as representative data as possible. A cost-based optimizer tries to determine the best index based on the statistics.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4.In the second session, choose Trace off and then Trace list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points if it is usefull ...&lt;/P&gt;&lt;P&gt;Girish&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2007 08:57:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-index/m-p/2396851#M533581</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-20T08:57:08Z</dc:date>
    </item>
  </channel>
</rss>

