Application Development and Automation 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: 
Read only

Query on table EABL & EABLG taking long

vikrant_guptarya
Participant
0 Likes
1,563

Hi Experts,

We have this code running for almost 4 years now. suddenly this piece of code has started taking 10 times more time.

I believe no increase in data in these tables could have increased the access time by 10 times in the last 4 days. We have also ran the stats for the table EABLG & EABL, but still the performance has not improved.

Please let me know if there is any remedy for this or should i raise a OSS message for this.

SELECT e~anlage

e~ablesgr

a~ablstat

e~adatsoll

FROM eablg AS e INNER JOIN

eabl AS a

ON eablbelnr = aablbelnr

INTO TABLE it_eabl_eablg

WHERE a~ablstat EQ '0'

AND e~ablesgr EQ '06'

AND e~anlage IN s_anlage.

IF it_eabl_eablg[] IS NOT INITIAL.

SELECT e1~anlage

e1~ablesgr

a1~ablstat

e1~adatsoll

FROM eablg AS e1 INNER JOIN

eabl AS a1

ON e1ablbelnr = a1ablbelnr

INTO TABLE it_eabl_eablg1

FOR ALL ENTRIES IN it_eabl_eablg

WHERE e1~anlage = it_eabl_eablg-anlage

AND e1~ablesgr EQ '03'.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,271

If this is not SAP code, I wouldn't bother raising an OSS message.

Rob

5 REPLIES 5
Read only

Former Member
0 Likes
1,272

If this is not SAP code, I wouldn't bother raising an OSS message.

Rob

Read only

Former Member
0 Likes
1,271

I would suggest to re-run the brconnect(table stats) , as the reason seems to be select query utilizing the wrong index .

Regards

Pawan

Read only

0 Likes
1,271

I don't think it's using the wrong index. I don't think there is any index it can use.

Rob

Read only

volker_borowski2
Active Contributor
0 Likes
1,271

Hi,

you need to check the DB execution plan. Compare the plan to QA system.

I assume due to some minor stats canges, your join order or the join method changed which might result in a big difference.

If the plan in QA is different than in PRD, post both.

if the plan of QA is better, export the table stats from QA to PRD for both tables

(sap note available for that) and lock the stats on those tables in PRD after that action.

Volker

Read only

0 Likes
1,271

Thanks guys.. Seems the stats update kicked in only after a day