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

Index

Former Member
0 Likes
710

What is the use of secondary index and disadvantages of secondary index?

What is the use of secondary index and disadvantages of secondary index?

5 REPLIES 5
Read only

Former Member
0 Likes
672

disadvantages

Creating an additional index could also have side effects on the performance. This is because an index that was used successfully for selection might not be used any longer by the optimizer if the optimizer estimates (sometimes incorrectly) that the newly created index is more selective.

The indexes on a table should therefore be as disjunct as possible, that is they should contain as few fields in common as possible. If two indexes on a table have a large number of common fields, this could make it more difficult for the optimizer to choose the most selective index.

Read only

Former Member
0 Likes
672

use

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

Read only

Former Member
0 Likes
672

Hi Balu,

The following details may help you.

1.If you cannot use the primary index to determine the result set because, for example, none of the fields primary index occur in the WHERE or HAVING clause, the system searches through the entire table (full table scan).

2.For this case, you can create secondary indexes, which can restrict the number of table entries searched to form the result set.

3. You should only create secondary indexes, for database tables from which you mainly read, since indexes have to be updated each time the database table is changed.

4.Secondary indexes should contain columns that you use frequently in a selection, and that are as highly selective as possible to improve performance.

Regards,

Thasneem

Reward if helpful

Read only

Former Member
0 Likes
672

Balu

Disadvantages:

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

you can check out the link below for more inforamation on indexes

http://www.idig.za.net/mysqlindexes/2006/11/09/

Advantages :

https://forums.sdn.sap.com/click.jspa?searchID=1052972&messageID=1633228

http://help.sap.com/saphelp_470/helpdata/en/cf/21eb20446011d189700000e8322d00/frameset.htm

sap.ittoolbox.com/documents/popular-q-and-a/specifying-the-index-to-be-used-2462

sap.ittoolbox.com/documents/popular-q-and-a/specifying-the-index-to-be-used-2462

http://www.sap-img.com/abap/quick-note-on-design-of-secondary-database-indexes-and-logical-databases...

Don't forget to reward if useful....

Read only

Former Member