<?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 index in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/index/m-p/2570466#M586856</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi experts,&lt;/P&gt;&lt;P&gt;what is primry index and secondary index. explain me with examples. when we have to create secondary index.&lt;/P&gt;&lt;P&gt;thanks in advance.&lt;/P&gt;&lt;P&gt;radhakrishna.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Jul 2007 06:07:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-26T06:07:13Z</dc:date>
    <item>
      <title>index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/index/m-p/2570466#M586856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi experts,&lt;/P&gt;&lt;P&gt;what is primry index and secondary index. explain me with examples. when we have to create secondary index.&lt;/P&gt;&lt;P&gt;thanks in advance.&lt;/P&gt;&lt;P&gt;radhakrishna.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2007 06:07:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/index/m-p/2570466#M586856</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-26T06:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/index/m-p/2570467#M586857</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;Primary index : Its the index which is automatically created for the PRIMARY KEY FIELD(S) of the table.&lt;/P&gt;&lt;P&gt;The primary index is always created automatically in the R/3 System. It consists of the primary key fields of the database table. This means that for each combination of fields in the index, there is a maximum of one line in the table. This kind of index is also known as UNIQUE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Secondary index : Its created as and when required,&lt;/P&gt;&lt;P&gt;based upon other field(s) of the table,&lt;/P&gt;&lt;P&gt;on which search criteria is used in sqls.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Secondary indexes should contain columns that you use frequently in a selection, and that are as highly selective as possible. The fewer table entries that can be selected by a certain column, the higher that column&amp;#146;s selectivity. Place the most selective fields at the beginning of the index. Your secondary index should be so selective that each index entry corresponds to at most five percent of the table entries. If this is not the case, it is not worth creating the index. You should also avoid creating indexes for fields that are not always filled, where their value is initial for most entries in the table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATION of secondary index&lt;/P&gt;&lt;P&gt;go to SE11&lt;/P&gt;&lt;P&gt;enter table name&lt;/P&gt;&lt;P&gt;press display&lt;/P&gt;&lt;P&gt;from menu GOTO-&amp;gt; indexes&lt;/P&gt;&lt;P&gt;press create button&lt;/P&gt;&lt;P&gt;enter the fields for which you need the index&lt;/P&gt;&lt;P&gt;save and activate&lt;/P&gt;&lt;P&gt;use those fields in the Where condition of the select statement and see&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;PURPOSE of secondary index : &amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;This is necessary if the table is frequently accessed in a way that does not take advantage of the sorting of the primary index for the access. Different indexes on the same table are distinguished with a three-place index identifier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generally it is used when field which u want is not a primary field . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Advatange:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. faster access to data when field is not a primary key field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Disadvatnage: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Slower down database table inset, update delete commands.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_470/helpdata/en/cf/21eb20446011d189700000e8322d00/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_470/helpdata/en/cf/21eb20446011d189700000e8322d00/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&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;Priyanka.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2007 06:08:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/index/m-p/2570467#M586857</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-26T06:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/index/m-p/2570468#M586858</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;Indexes - What are they and how can I use them? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An index helps to speed up selection from the database. An index is a sorted copy of selected database table fields. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The primary index is always automatically created in an ABAP-based SAP system. It consists of the primary key fields of the database table. This means, for each combination of the index fields exists a maximum of one record in the table. This kind of index is called a UNIQUE index. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the primary index cannot be used to determine selection result, (for example, the WHERE condition does not contain any primary index fields), the system searches the whole table. To prevent this, and determine the selection result by searching through a restricted number of database records, you can create a secondary index. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, you should not define an index for all possible fields in the WHERE condition. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Creating a secondary index &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the transaction ABAP Dictionary Change &amp;amp;#8594; Indexes... &amp;amp;#8594; Create to create an index. To make the index unique, select UNIQUE. To specify the fields that will comprise the index, choose "Choose fields". Then save and activate the index. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When to create an index &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is worth creating a secondary index when: &lt;/P&gt;&lt;P&gt;You want to select table entries based on fields that are not contained in an index, and the response times are very slow. &lt;/P&gt;&lt;P&gt;The EXPLAIN function in the SQL trace shows which index the system is using. You can generate a list of the database queries involved in an action by entering Transaction ST05 and choosing Trace on &amp;amp;#8594; Execute action &amp;amp;#8594; Trace off &amp;amp;#8594; List trace. If you execute the EXPLAIN SQL function on a EXEC, REEXEC, OPEN, REOPEN or PREPARE statement, the system returns a list containing the index used in the database query. &lt;/P&gt;&lt;P&gt;The field or fields of the new secondary index are so selective that each index entry corresponds to at most 5% of the total number of table entries. Otherwise, it is not worth creating the index. &lt;/P&gt;&lt;P&gt;The database table is accessed mainly for reading entries. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using an index consisting of several fields &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even if an index consists of several fields, you can still use it when only a few of the fields actually appear in the WHERE clause. The sequence in which the fields are specified in the index is important. You can only use a field in the index if all of the preceding fields in the index definition are included in the WHERE condition. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An index can only support search criteria which describe the search value positively, such as EQ or LIKE. The response time of conditions including NEQ is not improved by an index. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Optimal number of fields for an index &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An index should only consist of a few fields; as a rule, no more than four. This is because the index has to be updated each time you change its fields in a database operation. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fields to include in an index &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Include fields that are often selected and have a high selectivity. In other words, you need to check the proportion of the table entries that can be selected with this field. The smaller the proportion, the more selective the field. You should place the most selective fields at the beginning of the index. &lt;/P&gt;&lt;P&gt;If all of the fields in a SELECT statement are contained in the index, the system does not access the data a second time following the index access. If there are only a few fields in the SELECT statmeent, you can improve performance significantly by including all of these fields in the index. &lt;/P&gt;&lt;P&gt;You should not include a field in an index if its value is initial for most of the table entries. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Optimal number of indexes for a table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should not create more than five indexes for any one table because: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whenever you change table fields that occur in the index, the index itself is also updated. &lt;/P&gt;&lt;P&gt;The amount of data increases. &lt;/P&gt;&lt;P&gt;The optimizer has too many chances to make mistakes by using the 'wrong' index. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are using more than one index for a database table, ensure that they do not overlap. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Avoiding OR conditions &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The optimizer generally stops if the WHERE condition contains an OR expression. In other words, it does not evaluate the fields in the OR expression with reference to the index. &lt;/P&gt;&lt;P&gt;An exception to this are OR statements standing on their own. Try to reformulate conditions containing an OR expression for one of the indexed fields. For example, replace: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM SPFLI &lt;/P&gt;&lt;P&gt;             WHERE CARRID = 'LH' &lt;/P&gt;&lt;P&gt;             AND  (CITYFROM = 'FRANKFURT' OR  CITYFROM = 'NEW YORK'). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM SPFLI &lt;/P&gt;&lt;P&gt;             WHERE (CARRID = 'LH' AND CITYFROM = 'FRANKFURT') &lt;/P&gt;&lt;P&gt;             OR    (CARRID = 'LH' AND CITYFROM = 'NEW YORK'). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problems with IS NULL &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The value NULL is not stored in the index structure of some database systems. The consequence of this is that the index is not used for that field. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2007 06:10:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/index/m-p/2570468#M586858</guid>
      <dc:creator>seshatalpasai_madala</dc:creator>
      <dc:date>2007-07-26T06:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/index/m-p/2570469#M586859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Primary Index --&amp;gt; Primary index is nothing but all the key fields &lt;/P&gt;&lt;P&gt;Secondary Index --&amp;gt; We need to create the Secondary index&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Primary index : Its the index which is automatically created for the PRIMARY KEY FIELD(S) of the table.&lt;/P&gt;&lt;P&gt;The primary index is always created automatically in the R/3 System. It consists of the primary key fields of the database table. This means that for each combination of fields in the index, there is a maximum of one line in the table. This kind of index is also known as UNIQUE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Secondary index : Its created as and when required,&lt;/P&gt;&lt;P&gt;based upon other field(s) of the table,&lt;/P&gt;&lt;P&gt;on which search criteria is used in sqls.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Secondary indexes should contain columns that you use frequently in a selection, and that are as highly selective as possible. The fewer table entries that can be selected by a certain column, the higher that column&amp;#146;s selectivity. Place the most selective fields at the beginning of the index. Your secondary index should be so selective that each index entry corresponds to at most five percent of the table entries. If this is not the case, it is not worth creating the index. You should also avoid creating indexes for fields that are not always filled, where their value is initial for most entries in the table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATION of secondary index&lt;/P&gt;&lt;P&gt;go to SE11&lt;/P&gt;&lt;P&gt;enter table name&lt;/P&gt;&lt;P&gt;press display&lt;/P&gt;&lt;P&gt;from menu GOTO-&amp;gt; indexes&lt;/P&gt;&lt;P&gt;press create button&lt;/P&gt;&lt;P&gt;enter the fields for which you need the index&lt;/P&gt;&lt;P&gt;save and activate&lt;/P&gt;&lt;P&gt;use those fields in the Where condition of the select statement and see&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; Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2007 06:10:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/index/m-p/2570469#M586859</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-26T06:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/index/m-p/2570470#M586860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Primary Index : this is the index based on primary key of u'r transparent table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Secondary Index : there are some indexes which r given by SAP or u can create u'r own index(even in standard tables also).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just goto se11 n give any standard table name like mara,mkpf then click on index button u'll find secondary indexes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;don't forget to reward.&lt;/P&gt;&lt;P&gt;Sameer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2007 06:12:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/index/m-p/2570470#M586860</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-26T06:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/index/m-p/2570471#M586861</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 search a table for data records that satisfy certain search criteria faster using an index. &lt;/P&gt;&lt;P&gt;An index can be considered a copy of a database table that has been reduced to certain fields. This copy is always in sorted form. Sorting provides faster access to the data records of the table, for example using a binary search. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The index also contains a pointer to the corresponding&lt;/P&gt;&lt;P&gt;record of the actual table so that the fields not contained in the index can also be read. The primary index is distinguished from the secondary indexes of a table. The primary index contains the key fields of the table and a pointer to the non-key fields of the table. The primary index is created automatically when the table is created in the database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also create further indexes on a table in the ABAP Dictionary. These are called secondary indexes. This is necessary if the table is frequently accessed in a way that does not take advantage of the sorting of the primary index for the access.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Points to keep in mind while creating indexes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) The order of the fields in the index is very important for the accessing speed. &lt;/P&gt;&lt;P&gt;2) The first fields&lt;/P&gt;&lt;P&gt;should be those which have constant values for a large number of selections. During selection, an index is only of use up to the first unspecified field.&lt;/P&gt;&lt;P&gt;3) Only those fields that significantly restrict the set of results in a selection make sense for an index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) Additional indexes can also place a load on the system since they must be adjusted each time the table contents change. Each additional index therefore slows down the insertion of records in the table. If two indexes on a table have a large number of common fields, this could make it more difficult for the optimizer to choose the most selective index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5) A unique index for a client-dependent table must contain the client field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6) Several indexes on the same table are distinguished by a three-place index identifier. The index identifier may only contain letters and digits. The ID 0 is reserved for the primary index. The index name on the database adheres to the convention &amp;lt;Table name&amp;gt;~&amp;lt;Index ID&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex: TEST~A is the name of the corresponding database index in the database for table TEST and the secondary index with ID A.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note:&lt;/P&gt;&lt;P&gt;The only use of index is faster access of data base tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Always use all the fields for which the index has been created in where clause in Select statements.&lt;/P&gt;&lt;P&gt;Having too much index on the DB will make it slow the reason being , you know you have DB chunks and as well as Db spaces .&lt;/P&gt;&lt;P&gt; When you execute the select statement on the table that have lot of indexes it&amp;#146;s confuse compiler which combination to be used &lt;/P&gt;&lt;P&gt;and if your index have the common fields it try to gather all and then take the results in to buffer.&lt;/P&gt;&lt;P&gt; In this way you&amp;#146;re wasting Db resources as well as creating hurdle for performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds&lt;/P&gt;&lt;P&gt;Reshma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2007 06:16:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/index/m-p/2570471#M586861</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-26T06:16:34Z</dc:date>
    </item>
  </channel>
</rss>

