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 On key fields

Former Member
0 Likes
2,183

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

7 REPLIES 7
Read only

Former Member
0 Likes
1,364

Hi,

Why do you want to create an Index for the primary keys?

We create Indexes for non-primary keys.

Regards,

Subramanian

Read only

0 Likes
1,364

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

Read only

0 Likes
1,364

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

Read only

Former Member
0 Likes
1,364

If the table looks like:

f1 (key)
f2 (key)
f3 (key)
f4 (key)
f5 (key)
f6
f7
f8

You wouldn't want to create an index like:

f1
f2
f3

But you might want to create one like:

f2
f4
f6

But it's hard to tell without seeing the current table structure and the proposed new index.

Rob

Read only

Former Member
0 Likes
1,364

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

Read only

0 Likes
1,364

>

> 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

Read only

0 Likes
1,364

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