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

Primary index Usage

Former Member
0 Likes
776

HI GURUS,

I want to know about primary index that how system use it.

Like I am quering a table 'BSAK' which have 10 key fields. And in my query i am mentioning 4 key fields from different locations like 1, 3, 6, and 9 key field. and 1 non key field.

Now what database will do. It will use the primary index or not.

and is it important to mention client field 'mandt' when quering which is also a key field.

Thanks in advance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
749

hi

though u dont use, you have to all the key fields in the select statement in the order, along with your non-key field. that can work.

pavan

HI GURUS,

I want to know about primary index that how system use it.

Like I am quering a table 'BSAK' which have 10 key fields. And in my query i am mentioning 4 key fields from different locations like 1, 3, 6, and 9 key field. and 1 non key field.

Now what database will do. It will use the primary index or not.

and is it important to mention client field 'mandt' when quering which is also a key field.

Thanks in advance

5 REPLIES 5
Read only

Former Member
0 Likes
750

hi

though u dont use, you have to all the key fields in the select statement in the order, along with your non-key field. that can work.

pavan

Read only

Former Member
0 Likes
749

Hi,

The query will work fine. No problem in that.

And u do not have to mention 'MANDT' field in query.

Rgds,

Prakash

Read only

0 Likes
749

HI Mehra,

Question is not about query will work fine or not. But i want to know that if system will use the primary index for searching of record or not.

If we have 10 key fields and we mention 4 or 5 key fields and a non key field.

system will use the primary index or not????

Thanks

Read only

Former Member
0 Likes
749

Hi,

As per my knowledge, if we have 10 fields as primary keys, index is going to maintain for the composite primary key, if you specifiy all primary keys in your select statement data retrival will be very fast because it going to find what is the exact record for composite key, other wise it is going to check all the records matching to your where condition and retrive all this will cause major performance issue.

Read only

Former Member
0 Likes
749

Hi ,

No . It wont use Primary Index . It will search all the records .

If we want to increase the performance we can create secondary index

using those 4 fields alone .

Regards ,

Senthil