11-27-2017 6:24 AM
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
11-27-2017 7:04 AM
11-27-2017 7:44 AM
Thanks for your comment. yes they have same data. These tables have 1 more index.
11-27-2017 7:50 AM
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 ?
11-27-2017 8:19 AM
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.
11-27-2017 8:52 AM
Your index is used and not seems to be so huge
Did you use a FOR ALL ENTRIES in your code ?
11-27-2017 9:04 AM
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.
11-28-2017 9:15 AM
I tried, deleting the secondary index and re-transported it. It is still not working. Your inputs will be highly appreciated.
*comment edited
11-28-2017 10:44 AM
11-28-2017 12:02 PM
Hi Raymond,
Thannks for your reply.
12-06-2017 4:12 AM
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