Application Development 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: 

Performance Issue : Incosistent behaviour after secondary index creation in different environments

Mohamed_Mukhtar
Active Contributor
0 Kudos

Hi ,

We have created secondary index ‘on database tables A952, A954 and A955 in Dev environment and transported secondary indexes to STG1 and STG2 environments respectively with fields MANDT,KAPPL and MATNR.

The behavior of STG1 and STG2 environment to fetch data from db tables A952, A954 and A955(using select statement) is inconsistent after rebuilding and updating statistics of the newly created secondary index Z02.

SAP STG1 Environment:

Table A954, A952: Select statement is consuming least time to fetch data from these two tables and is picking the Z02 index

Table A955: Select statement is consuming time and doing a full scan.

SAP STG2 Environment:

Table A954: Select statement is consuming least time to fetch data from these two tables is picking the Z02 index

Table A955, A952: Select statement is consuming time and doing a full scan.

I have even used %Hints statement on the tables which are time consuming but without any luck.

Am I missing anything here. Appreciate your inputs to resolve this issue.

Thanks in advance.

-Always Learner

10 REPLIES 10

matt
Active Contributor
0 Kudos

Do they have the same data? Are there other secondary indices?

Mohamed_Mukhtar
Active Contributor
0 Kudos

Thanks for your comment. yes they have same data. These tables have 1 more index.

FredericGirod
Active Contributor
0 Kudos

Do you have make a SQL trace (ST05) and used the Explain to check witch index is used without %HINTS ? and the evaluation of the cost by SAP ?

Mohamed_Mukhtar
Active Contributor
0 Kudos

Hi Frederic,

The below is the execution plan without hints. I am able to see the execution plan from ST04 unable to capture this in St05 trace due to timeout issue.

FredericGirod
Active Contributor
0 Kudos

Your index is used and not seems to be so huge

Did you use a FOR ALL ENTRIES in your code ?

Mohamed_Mukhtar
Active Contributor
0 Kudos

Thanks Frederic. Yes I used for all entries in my code. Sorted and deleted duplicate entries from internal table before using it in FOR ALL entries.

Mohamed_Mukhtar
Active Contributor
0 Kudos

I tried, deleting the secondary index and re-transported it. It is still not working. Your inputs will be highly appreciated.

*comment edited

raymond_giuseppi
Active Contributor
0 Kudos
  • Could you check technical settings for those tables in the various system, look for buffering parameters?
  • Did you create the index without client field?

0 Kudos

Hi Raymond,

Thannks for your reply.

  1. Technical settings are same for these tables across systems. Buffering Switched On and buffering type is fully buffered.
  2. Created index with MANDT field.

Mohamed_Mukhtar
Active Contributor
0 Kudos

Hi ,

We went ahead and moved the secondary indexes to production system as there was no risk involved.

The secondary indexes worked in production :-). I am keeping this thread as open since I haven't found RCA.

I am still working to find the possible root cause and will update here accordingly.

I am requesting SCN folks to share their inputs.

Thanks

-Learner