Application Development and Automation 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: 
Read only

indexing atable

Former Member
0 Likes
705

pls any body can giv example to how to create primary index and secondary index in atable

6 REPLIES 6
Read only

Former Member
0 Likes
680

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

Read only

Former Member
0 Likes
680

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.

Read only

Former Member
Read only

Former Member
0 Likes
680

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

Read only

p291102
Active Contributor
0 Likes
680

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

Read only

Former Member
0 Likes
680

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