Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

indexes

Former Member
0 Likes
688

is it possible to create secondary index without primary index?

is so any consistency implications will be there?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
655

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?

4 REPLIES 4
Read only

Former Member
0 Likes
656

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

Read only

Former Member
0 Likes
655

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.

Read only

Former Member
0 Likes
655

How we can create secondary index with out primary index, it is an sap default one.

Read only

Former Member
0 Likes
655

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.