‎2007 Apr 26 9:15 AM
Hi ,
How many Primary ,Secondary index can be there for a table ?
‎2007 Apr 26 9:16 AM
Hi kumar,
1. Primary can only be one.
2. Secondary can be many, depending upon the database limits.
regards,
amit m.
‎2007 Apr 26 9:16 AM
Hi kumar,
1. Primary can only be one.
2. Secondary can be many, depending upon the database limits.
regards,
amit m.
‎2010 Mar 19 7:33 AM
‎2007 Apr 26 9:17 AM
The Number of primary key columns per table is 512.
Check this link for more info:
http://www.sapdb.org/htmhelp/32/60a014540911d5a9fd00a0c9449261/frameset.htm
Regards,
Ravi
‎2007 Apr 26 9:20 AM
Hi Kumar,
Go through this info.
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 :
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?
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
Primary can only be one.
Secondary can be many, depending upon the database limits.
Rgds,
P.Naganjana Reddy
‎2007 Apr 26 9:20 AM
Primary is one .
Secondary can be many , but creating many will cause performance issues and may also cause wrong picking of the index for a select
‎2007 Apr 26 9:21 AM
Hi Kumar,
There can be only one <b>primary index</b> but can have more than one <b>secondary index</b> for a table.
<b>Reward points if it solves ur query or answer is helpful</b>
Thanks
Chinmay
‎2007 Apr 26 9:21 AM
‎2007 Apr 26 9:25 AM
Hi kumar
You can create your index via SE11, enter the table name, click change, choose Go To, Indexes. Here create your index with the key fields that you want. To use the index, your select statement WHERE clause, you must have the key fields of the index in the order that they appear in the index. The "optimizer" will choose the index depending on your fields of the WHERE clause.
One thing to remember is that when you create indexes for tables, the update or insert of these tables may have a slower response then before, I for one have never seen a big problem as of yet.
this Document may help u on primary and secondary indexes :
http://jdc.joy.com/helpdata/EN/cf/21eb20446011d189700000e8322d00/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb47446011d189700000e8322d00/content.htm
There is no limit specified by SAP. But when we create more number of secondary indices, the system takes more times in choosing the proper index while executing the SELECT statement.
As per the SAP help..
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.
Check the below sap link for more details.
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb2d446011d189700000e8322d00/content.htm
https://forums.sdn.sap.com/click.jspa?searchID=728985&messageID=1884447
https://forums.sdn.sap.com/click.jspa?searchID=728985&messageID=1633228
http://www.sap-img.com/abap/important-abap-faq.htm
http://help.sap.com/saphelp_nw04/helpdata/en/80/1a6473e07211d2acb80000e829fbfe/content.htm
Regards,
Rk