Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Order of fields in Primary key in where clause

Hello,

Does order of fields(complete primary key) in where condition matters with the performance or using of index ?

Here is an example -

BKPF has primary key - bukrs, gjahr, belnr.

1. select single awkey into lv_awkey

from bkpf where bukrs = p_bukrs

and gjahr = p_gjahr

and belnr = p_belnr.

2. select single awkey into lv_awkey from bkpf

where bukrs = p_bukrs and

belnr = p_belnr and

gjahr = p_gjahr.

Does it make any difference in performance point of view with above two kinds ? Is that same applicable when accessing based on secondary index ?

Thanks,

Nagarjuna

Former Member
replied

using all the primary key / index is performance oriented approach.. order does not matter.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question