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

Delete from small DB table takes forever

Vitaliy-R
Developer Advocate
Developer Advocate
0 Likes
844

Hello,

I am executing standard SAP progam (RSDDSTAT_DATA_DELETE) that should delete some records from the BW table RSDDSTATAGGR.

DELETE FROM RSDDSTATAGGR WHERE timestamp <= 'xxx'.

Although there are only few records (like 30 records) this step takes forever.

What might be root-causes for this?

Your help will be appreciated.

Thank you

Vitaliy

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
801

Hi Vitaliy,

Root Cause: Seems the where claus has timestamp, which is not a key field and it is also a long text field. It's taking time.

Solution: Please do following.

1. Use select query and select records into internal table say ITAB.

2. Sort this ITAB by the key field of the table.

3. use following delete statement.

DELETE RSDDSTATAGGR FROM ITAB.

Hope this will improve performance.

Thank you,

Message was edited by:

Darshan Patel

Hello,

I am executing standard SAP progam (RSDDSTAT_DATA_DELETE) that should delete some records from the BW table RSDDSTATAGGR.

DELETE FROM RSDDSTATAGGR WHERE timestamp <= 'xxx'.

Although there are only few records (like 30 records) this step takes forever.

What might be root-causes for this?

Your help will be appreciated.

Thank you

Vitaliy

5 REPLIES 5
Read only

Former Member
0 Likes
802

Hi Vitaliy,

Root Cause: Seems the where claus has timestamp, which is not a key field and it is also a long text field. It's taking time.

Solution: Please do following.

1. Use select query and select records into internal table say ITAB.

2. Sort this ITAB by the key field of the table.

3. use following delete statement.

DELETE RSDDSTATAGGR FROM ITAB.

Hope this will improve performance.

Thank you,

Message was edited by:

Darshan Patel

Read only

0 Likes
801

Hi Vitaliy,

Please feel free to send me email for further query.

Darshan

Read only

Former Member
0 Likes
801

Hi Vitaliy,

This BW table has the timestamp value in its field STARTTIME.

But this time stamp is in long form.. so if you want to give a condition, say that delete all records which are older than 03.09.2007, then you will need to convert this data and time to long form first..

and then you can use that in the condition..

Thanks and Best Regards,

Vikas Bittera.

Read only

Vitaliy-R
Developer Advocate
Developer Advocate
0 Likes
801

Gentlemen,

Thank you for your replies. Unfortunately it seems I made an error. I debugged the program and it does not stop on DELETE statement, but after it where program goes into infinitive loop when another table - RSDDSTATTREX - is empty.

Sorry for that, but I appreciate your replies.

- Vitaliy

Read only

Vitaliy-R
Developer Advocate
Developer Advocate
0 Likes
801

Wrong question. Sorry