2009 Oct 29 6:41 PM
Hi,
I would like to know should we create indexes on key fields in custom tables.
Regards
Sai
Hi,
I would like to know should we create indexes on key fields in custom tables.
Regards
Sai
2009 Oct 29 6:52 PM
Hi,
Why do you want to create an Index for the primary keys?
We create Indexes for non-primary keys.
Regards,
Subramanian
2009 Oct 29 6:57 PM
Hi Subramaniyan,
There is a client requirement to create index for performance in custom table.
So i got doubt should we create or what?
Regards
Sai
2009 Oct 29 7:11 PM
Hi,
Check the program that uses this table and see the where condition on the sql query.
If it already uses the primary key, then no need, but if it uses non-primary keys, then try craeting indexes on those.
If the table is a huge table, check the buffering option and turn it off.
If the table also has "Log Data Changes" checked that will also reduce performance.
Regards,
Subramanian
2009 Oct 29 7:09 PM
If the table looks like:
f1 (key)
f2 (key)
f3 (key)
f4 (key)
f5 (key)
f6
f7
f8You wouldn't want to create an index like:
f1
f2
f3But you might want to create one like:
f2
f4
f6But it's hard to tell without seeing the current table structure and the proposed new index.
Rob
2009 Oct 29 7:31 PM
there are two types of index .. primary and secondary..
creating index means creating a secondary index...
primary index are the primary key combination... you dont create them again...
creating index will only be needed for key combination including the nonkey elements(must) and may or may not have primary key elements...
[index|http://help.sap.com/saphelp_nw04/helpdata/EN/cc/7c58b369022e46b629bdd93d705c8c/content.htm]
this link will help
2009 Oct 29 7:39 PM
>
> creating index will only be needed for key combination including the nonkey elements(must) and may or may not have primary key elements...
A secondary index must include some non primary key fields. Is that correct?
Rob
2009 Oct 29 7:50 PM
no rob,
my bad... placed it wrong... (thinking of some thing else and placed wrongly)
it can be a combination of both keyfield and nonkey fields..
depends upon how we are doing to need it.. lets say the fields which comes in our where clause in a select statement..
thanks for pointing out..