Application Development 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: 

secondary index for MSEG

Former Member
0 Kudos
330

I want to create a secondary index for the table mseg with the following fields:

werks

bwart

ebeln

ebelp

xauto

erfmg

smbln

Since the order of the fields is very important, Pls suggest me the order of the fields should be given for this.

1 ACCEPTED SOLUTION

chaiphon
Contributor
0 Kudos
107

You need to sort the order according to the logic you used for selecting from MSEG tables. Make sure you order it starting from the fields you always use for selecting data otherwise it will not use your index.

For performance and whether you should create and index or not, please check on transaction DB05. it help you analysis the field. the more unique key, the more reduction in term of selecting time.

Cheers,

Chaiphon

3 REPLIES 3

chaiphon
Contributor
0 Kudos
108

You need to sort the order according to the logic you used for selecting from MSEG tables. Make sure you order it starting from the fields you always use for selecting data otherwise it will not use your index.

For performance and whether you should create and index or not, please check on transaction DB05. it help you analysis the field. the more unique key, the more reduction in term of selecting time.

Cheers,

Chaiphon

Former Member
0 Kudos
107

For creating a secondary index in SE11,

1. Click 'INDEX' button

2. Click 'CREATE' in the Index Dialog window.

3. Give Index name and click continue.

4. Fill short description and select Unique or Non-unique index

5. Click 'TABLE FIELDS' button; select your seven fields for secondary index and click 'COPY'.

This will copy the index fields.

Better to have this sequence in secondary index and follow the same sequence while using where clause in select statement.

raymond_giuseppi
Active Contributor
0 Kudos
107

Take a look at transaction [ST04 DB Performance Monitor|http://help.sap.com/saphelp_nw04/helpdata/en/3d/11ffa78c672844a242ed4a85a4da31/frameset.htm] , select "Indexes Advised" and look for MSEG.

The order of fields depend on the usage of the table on YOUR system.

Regards,

Raymond