Skip to Content
0
May 14, 2010 at 07:59 AM

Different index used in same code segments

27 Views

Hi,

I noticed the following peculiar behaviour when trying to troubleshoot the long running time of an ABAP :

1) while doing an SQL trace (ST05) of the long running program, the trace results show that index "A" was being used.

2) when I took that particular SELECT code segment of the program and ran it by itself, the trace results showed that index "B" was used and that the data retrieval was very fast

It is obvious that index "A" is the incorrect index to be used but how do we "influence" the use of index "B" (the correct index) to be used during program runtime?

And why did the program use the incorrect index in the first place?

Has anyone encountered similar situation?

Thanks in advance.