Skip to Content
Former Member
Oct 15, 2008 at 05:01 AM

On what basis does the optimiser select the index



The following select statement is causing a performance issue.

SELECT SINGLE belnr FROM bkpf INTO bkpf-belnr

WHERE bukrs = t_input_invoice-detenteur_compte_banc

AND gjahr = w_gjahr

AND blart = 'ZR'

AND bstat IN r_bstat

AND xblnr LIKE w_bktxt.

When I checked in ST04 transaction,the optimiser is selecting BKPF3 index having fields bukrs,bstat and blart which are present in the where condition of the select statement.But there is also one more index BKPF1 having fields bukrs,bstat and xblnr which are also present in the where condition of the select statement.

On what basis did the optimiser select BKPF~3 index?

Can anyone explain.