Answer Posted / shreeshaildiggi
Indexes - What are they and how can I use them?
An index helps to speed up selection from the database. An
index is a sorted copy of selected database table fields.
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.
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.
However, you should not define an index for all possible
fields in the WHERE condition.
Creating a secondary index :
You can use the transaction ABAP Dictionary Change →
Indexes... → 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.
Optimal number of indexes for a table :
You should not create more than five indexes for any one
table because:
Whenever you change table fields that occur in the index,
the index itself is also updated.
The amount of data increases.
The optimizer has too many chances to make mistakes by
using the 'wrong' index.
If you are using more than one index for a database table,
ensure that they do not overlap.
Thank's and Regards
Shreeshail Diggi
SAP Technical Consultant Infinite India
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are the attributes of the data in data dictionary? : abap data dictionary
Difference between sy-tabix and sy-index?
Update types in Call transaction method. What is the difference?
What kind of financial periods exist in sap? What is the relavent table for that?
What is an interactive report? What is the obvious difference of such report compared with classical type reports?
Explain about interactive report?
What is the use of at new statement ?
Why lsmw does not support call transaction method? : abap bdc
singleton class
What two statements are required in an abap program to output an icon using a write statement?
Explain what is step-loop? Explain all the steps?
Event handling in oops
How many types of size categories and data classes are there? : abap data dictionary
What is a table attribute?
How do you delete duplicate records from internal table?