08-23-2008 1:55 PM
Hi Gurus..
I would like to know that is it advisable to create to index on Primary keys.
suppose i have 8-10 PK with the table so can i go for Index for 3-4 fields from that PF list ??
-Maharshi
08-27-2008 3:34 PM
Hi,
By default Primary index is created on Primary key fields.
However you can generate the secondary index on the primary key to make your search/Selection much faster.
Example:
Let your table contains 20 feilds like:f1,f2,...f20.
f1 to f10 are primary keys.
Then Primary index will be on f1 to f10.
Seconsry index can be created on f2,f5,f7.
Regards,
Rama.P
08-23-2008 4:23 PM
It is possible, however I'm not sure if it is advisable. This depends on the fields you have in mind. There are some guidelines for this. Read the following link:
[What to Keep in Mind for Secondary Indexes|http://help.sap.com/saphelp_nw70/helpdata/EN/cf/21eb2d446011d189700000e8322d00/content.htm]
08-23-2008 10:41 PM
Hi Maharshi,
I assume you ask if it is advisable to create a secondary index on parts of the columns which build the primary key. Plural is not correct for the primary key, because there is only one per table. But it could have multiple columns or fields.
If this was your question, then it is possible and sometimes advisable. There is even one table D010INC where the secondary key has the same columns like the primary key but with oposite order. Primary key is build of both columns master and include and secondary key is build of include and master. But as already mentioned it does not always make sense. When your fields are not very selective or your query, for which you want to create the index, is not often used but the table is heavily changed, then it could be not advisable.
The bottom line is, with that little information you supplied, it could be advisable or not dependent on your table, fields, data distribution and SQL statements.
Regards
Ralph
08-27-2008 3:34 PM
Hi,
By default Primary index is created on Primary key fields.
However you can generate the secondary index on the primary key to make your search/Selection much faster.
Example:
Let your table contains 20 feilds like:f1,f2,...f20.
f1 to f10 are primary keys.
Then Primary index will be on f1 to f10.
Seconsry index can be created on f2,f5,f7.
Regards,
Rama.P