What are indexes?

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


Please Help Members By Posting Answers For Below Questions

While doing bdc exp va01 transaction sometime in the item level data shows only 4 items and other times it will show 6 line items, how will you maintain this kind of screen resolutions scenerio? : abap bdc

990


What are the difference between call screen and leave screen?

791


Select up to 1 row and select single difference ?

835


Explain how do you use structures in the abap programs?

741


How to debug a script in abap?

813


Workbench request are client dependent or client independent

770


What is the difference between synchronous and asynchronous updates?

790


How do you write manual bdc session method? : abap bdc

796


I am trying to automate a manual processing of iDOCs in BD87. I used the following code to pass idoc-id to global variable 'DCN' and then skip the first screen of BD87 to go to processing directly. After running this code SET PARAMETER ID 'DCN' FIELD itabhdr-idoc_id. CALL TRANSACTION 'BD87' AND SKIP FIRST SCREEN. it takes me to the first screen because it cannot recognize my idoc-id. How I can pass idoc-id to global? I have used the above code to goto VA02 with VBELN and it worked perfectly.

2016


What is a transaction variant and why are they used?

784


what is the purpose of BAPI BAPI_CUSTMATINFO_GETLIST What is input and output of this BAPI.

2304


Which table stores the programs created?

806


What are the various events associated with screen programming?

963


There is a situation where there is a field "MATERIAL DESCRIPTION" in say 20 display only transaction. You want that whenever user opens any of these transaction, this particular field is masked with ****. But table does not holds ****. It holds the actual value. What are different ways of doing it? Which is the best way.

1132


What is internal payroll process? : sap abap hr

799