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

Former Member
0 Kudos

hi,

what is the use of secondary index?

thanks regards,

kiran.

3 REPLIES 3

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

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

Please make sure to award points for helpful answers and mark your posts as solved when solved completely. THanks.

Regards,

Rich Heilman

Former Member
0 Kudos

Hi,

They are used to speed up the identification of records in a table when the select criteria doesn't involve primary key fields.

For complete details refer this document from help.sap.com

<u>http://help.sap.com/saphelp_46c/helpdata/en/4f/991f82446d11d189700000e8322d00/frameset.htm</u>

Regards,

Ben.

Former Member
0 Kudos

Kiran,

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..

Hope this will give you clear idea about Secondary index.

When you create table it always generate primary index with key fields.

Cheers,

Nilesh