‎2007 Mar 19 8:17 AM
pls any body can giv example to how to create primary index and secondary index in atable
‎2007 Mar 19 8:19 AM
Primary index is created by default on the database when the table is activated. Primary index contains the primary keys of the table.
Secondary indexes are user defined indexes and are created via SE11 on need basis to facilitate faster access to database tables.
Regards,
Santosh
‎2007 Mar 19 8:20 AM
Hi Durga,
Primary index is by default created on key fields
Secondary index is created on non key fields to improve performance
maximum of 9 secondary indexes can be created for a table
Refer this link:
http://help.sap.com/saphelp_nw04/helpdata/en/cc/7c58b369022e46b629bdd93d705c8c/frameset.htm
http://help.sap.com/saphelp_470/helpdata/en/cf/21eb20446011d189700000e8322d00/frameset.htm
Regards,
Priyanka.
‎2007 Mar 19 8:20 AM
hi Durga,
Refer
http://help.sap.com/saphelp_nw04/helpdata/en/cc/7c58b369022e46b629bdd93d705c8c/frameset.htm
http://www.saptechnical.com/Tips/ABAP/SecondaryIndexes.htm
Regards,
Santosh
Message was edited by:
Santosh Kumar Patha
‎2007 Mar 19 8:20 AM
Hi,
Primary Index will be created automatically. U can create Secondary Indexes.
Go to se11 and Click on GO TO and click on Indexes. Create Index for the key which want. Check the option "Unique" to store indatabase and " Non Unique" to store in database upon conditions.
Regards
Kannaiah
‎2007 Mar 19 8:21 AM
Hi,
Basically index are provided to improver performance. i.e with index select on db tables retrieves data much faster.
If you are writting select statement on the table where in where clause you have non-primary keys then it takes longer to retriev data from DB table.
If you have select in dbtable on non-primary key you can create Secondary index with keys as per your where clause which result in faster DB table access.
But remember not to create too many secondary indexes on same table which could result in slow / degrage performance..
Secondary indexes are used to enhancement performance when retrieving data. For example, say you have a table AFKO where the key to the table is AUFNR. You can select data from this table using AUFNR, the performance will be great because you are using the key. Say you need to hit this table with GLTRP(finish date), it is not part of the key, so the performance would be poor. If you created a secondard index using this field GLTRP, the performance would be improved. Make sense?
http://help.sap.com/saphelp_470/helpdata/en/cf/21eb20446011d189700000e8322d00/frameset.htm
Regards,
Shankar
‎2007 Mar 19 8:29 AM
Hi Durga,
There is a default primary index for all the tables and that is created by SAP on the primary key fields(You can display the indexes by SE11>Utilitie> Databaseobject>Display). The secondary indexes can be created by SE11>Indexes(in the application tool bar)>Give an index name(Ex Z1)>Give the fields on which the index should be there(Include MANDT field as the first column in any index you create) --> Save.
Thanks,
Vinay reddy