2009 Nov 10 12:56 PM
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.
2009 Nov 10 2:10 PM
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
2009 Nov 10 2:10 PM
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
2009 Nov 10 2:41 PM
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.
2009 Nov 10 2:57 PM
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