Skip to Content
Former Member
Dec 16, 2013 at 02:45 AM

Too many plants existing in SAP causing db choose wrong index


Hi Expert,

There're about 130 plants in our SAP. From last month, there're SQL running timeout dumps sometimes.

When I trace the log I found that the DB tends to choose index of 'WERKS'(plant) to find data.

for example,

select xxxxx

from vbap

inner join vbak on vbak~vbeln = vbap~vbeln

into corresponding fields of table xxxxx

where vbak~erdat in s_erdat

and vbap~werks eq p_werks.

For there is SO data for about 5 years in our SAP. So choosing the index of vbak-erdat is preferable, what is the DB did before last month.

This month I found the DB tends to choose the index of vbap-werks so that causing SQL timeout.

Are there some solutions?

I cannot use the key work 'HINT', for there are mass number of reports, queries involved, from vbap-werks to ekpo-werks,

from marc-werks to mseg-werks.

What is worse, we may involve 40 more plants next year...