<?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: Secondary Index Select Statement Problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/secondary-index-select-statement-problem/m-p/8066863#M1613219</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;&amp;gt; ONe more question: is it possible to give more than one index name in select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yes you can:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read the documentation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://download.oracle.com/docs/cd/A97630_01/server.920/a96533/hintsref.htm#5156" target="test_blank"&gt;http://download.oracle.com/docs/cd/A97630_01/server.920/a96533/hintsref.htm#5156&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
index_hint:

This hint can optionally specify one or more indexes:

- If this hint specifies a single available index, then the optimizer performs 
a scan on this index.  The optimizer does not consider a full table scan or 
a scan on another index on the table. 

- If this hint specifies a list of available indexes, then the optimizer 
considers the cost of a scan on each index in the list and then performs 
the index scan with the lowest cost. The optimizer can also choose to 
scan multiple indexes from this list and merge the results, if such an 
access path has the lowest cost. The optimizer does not consider a full 
table scan or a scan on an index not listed in the hint.
 
- If this hint specifies no indexes, then the optimizer considers the 
cost of a scan on each available index on the table and then performs 
the index scan with the lowest cost. The optimizer can also choose to 
scan multiple indexes and merge the results, if such an access path 
has the lowest cost. The optimizer does not consider a full table scan. &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, 13 Jul 2011 09:52:06 GMT</pubDate>
    <dc:creator>HermannGahm</dc:creator>
    <dc:date>2011-07-13T09:52:06Z</dc:date>
    <item>
      <title>Secondary Index Select Statement Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/secondary-index-select-statement-problem/m-p/8066860#M1613216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a issue with a select statement using secondary index,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM VEKP WHERE VEGR4 EQ STAGE_DOCK&lt;/P&gt;&lt;P&gt;                                  AND VEGR5 NE SPACE&lt;/P&gt;&lt;P&gt;                                  AND WERKS EQ PLANT&lt;/P&gt;&lt;P&gt;        %_HINTS ORACLE&lt;/P&gt;&lt;P&gt;        'INDEX("&amp;amp;TABLE&amp;amp;" "VEKP~Z3" "VEKP^Z3" "VEKP_____Z3")'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;given above statement is taking long time for processing. &lt;/P&gt;&lt;P&gt;when i check for the same secondary index in vekp table i couldn't see any DB index name with vekp~z3 or vekp^z3 or vekp____z3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the sy-subrc value after select statement is 4. (even though values avaliable in VEKP with given where condition values)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My question is why my select statement is taking long time and sy-subrc is 4?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;what happens if a secnodary index given in select statement, which is not avaliable in that DB Table?&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2011 10:47:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/secondary-index-select-statement-problem/m-p/8066860#M1613216</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-12T10:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: Secondary Index Select Statement Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/secondary-index-select-statement-problem/m-p/8066861#M1613217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The syntax looks strange to me, if index Z3 of table VEKP should be forced, then for Oracle it would look like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;%_HINTS ORACLE 'INDEX("VEKP" "VEKP~Z3")'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have no idea if your Z3 index exists, how it looks like, how much data is in VEKP, how distinctive the fields in your where-condition are, so it is not possible to answer your question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the index does not exist, then the hint is being ignored and the best index is chosen by the CBO, as far as I know. You can verify this yourself by doing a SQL-trace ST05.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2011 10:56:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/secondary-index-select-statement-problem/m-p/8066861#M1613217</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2011-07-12T10:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: Secondary Index Select Statement Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/secondary-index-select-statement-problem/m-p/8066862#M1613218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas.&lt;/P&gt;&lt;P&gt;Thanks for spot reply, the DB tablex doesn't have index called 'Z3'.&lt;/P&gt;&lt;P&gt;when i use the same where condition in DB table to find the records its giving 306 records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ONe more question: is it possible to give more than one index name in select statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2011 04:29:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/secondary-index-select-statement-problem/m-p/8066862#M1613218</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-13T04:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: Secondary Index Select Statement Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/secondary-index-select-statement-problem/m-p/8066863#M1613219</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;&amp;gt; ONe more question: is it possible to give more than one index name in select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yes you can:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read the documentation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://download.oracle.com/docs/cd/A97630_01/server.920/a96533/hintsref.htm#5156" target="test_blank"&gt;http://download.oracle.com/docs/cd/A97630_01/server.920/a96533/hintsref.htm#5156&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
index_hint:

This hint can optionally specify one or more indexes:

- If this hint specifies a single available index, then the optimizer performs 
a scan on this index.  The optimizer does not consider a full table scan or 
a scan on another index on the table. 

- If this hint specifies a list of available indexes, then the optimizer 
considers the cost of a scan on each index in the list and then performs 
the index scan with the lowest cost. The optimizer can also choose to 
scan multiple indexes from this list and merge the results, if such an 
access path has the lowest cost. The optimizer does not consider a full 
table scan or a scan on an index not listed in the hint.
 
- If this hint specifies no indexes, then the optimizer considers the 
cost of a scan on each available index on the table and then performs 
the index scan with the lowest cost. The optimizer can also choose to 
scan multiple indexes and merge the results, if such an access path 
has the lowest cost. The optimizer does not consider a full table scan. &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, 13 Jul 2011 09:52:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/secondary-index-select-statement-problem/m-p/8066863#M1613219</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2011-07-13T09:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: Secondary Index Select Statement Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/secondary-index-select-statement-problem/m-p/8066864#M1613220</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;read your second post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you want to transform the oracle hint&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM VEKP WHERE VEGR4 EQ STAGE_DOCK&lt;/P&gt;&lt;P&gt;AND VEGR5 NE SPACE&lt;/P&gt;&lt;P&gt;AND WERKS EQ PLANT&lt;/P&gt;&lt;P&gt;%_HINTS ORACLE&lt;/P&gt;&lt;P&gt;'INDEX("&amp;amp;TABLE&amp;amp;" "VEKP~Z3" "VEKP^Z3" "VEKP_____Z3")'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; to a DB6 DB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read SAP Note: 868888.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The corresponding hint would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM VEKP WHERE VEGR4 EQ STAGE_DOCK&lt;/P&gt;&lt;P&gt;AND VEGR5 NE SPACE&lt;/P&gt;&lt;P&gt;AND WERKS EQ PLANT&lt;/P&gt;&lt;P&gt;%_HINTS DB6 'IXSCAN TABLE = "VEKP" INDEX = ''"VEKP~Z3"'' /&amp;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>Thu, 14 Jul 2011 18:06:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/secondary-index-select-statement-problem/m-p/8066864#M1613220</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2011-07-14T18:06:52Z</dc:date>
    </item>
  </channel>
</rss>

