2006 Aug 19 1:22 PM
is it possible to create secondary index without primary index?
is so any consistency implications will be there?
2006 Aug 19 1:53 PM
Hi,
Primary index will be created by R3 itself, every database table will have their primary index.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
If you cannot use the primary index to determine the result set because, for example, none of the primary index fields occur in the WHERE or HAVING clause, the system searches through the entire table (full table scan). For this case, you can create secondary indexes, which can restrict the number of table entries searched to form the result set.
Thanks
Sudheer
is it possible to create secondary index without primary index?
is so any consistency implications will be there?
2006 Aug 19 1:53 PM
Hi,
Primary index will be created by R3 itself, every database table will have their primary index.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
If you cannot use the primary index to determine the result set because, for example, none of the primary index fields occur in the WHERE or HAVING clause, the system searches through the entire table (full table scan). For this case, you can create secondary indexes, which can restrict the number of table entries searched to form the result set.
Thanks
Sudheer
2006 Aug 19 2:26 PM
Primary index : Its the index which is automatically created for the PRIMARY KEY FIELD(S) of the table.
Secondary index : Its created as and when required,
based upon other field(s) of the table,
on which search criteria is used in sqls.
2006 Aug 22 11:41 AM
How we can create secondary index with out primary index, it is an sap default one.
2006 Aug 22 11:58 AM
hi,
Primary index:
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.
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.
<b>
We should not create more secondary indexes as Indexes have to be updated each time the database table is changed.</b>
Few points to be remembered while creating secondary indexes:
So, its better not to create multiple secondary indexes.
As a rule, secondary indexes should not contain more than four fields, and you should not have more than five indexes for a single database table. If a table has more than five indexes, you run the risk of the optimizer choosing the wrong one for a particular operation.
For this reason, you should avoid indexes with overlapping contents. 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'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.
Regards,
Sailaja.