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

Performance tuning for UPDATE statement.

ameya_kulkarni3
Participant
0 Likes
2,296

There is an UPDATE statement that is very high in cost. I wanted to know whether there is any possibility of tuning the statement..by using any general methods like where statements,Indexes etc..?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,182

Hi ,

If you are updating from wark_area ( i.e Update ... from wa ) then it is allways better specify all key fields value in the wark_area.

If you are updating from internal table ( Update ... Table itab ) then it is allways better specify all records of the table in sorted manner.

If in your Update statement having where clause then Try to specify all the key fields left-justifiedly with out any gaps and if it is not possible then provide fields in where clause with-out missing any field .

If you are often using one or more than one same fields ( other than key fields ) , you can create a secondary index with those fields.

Regards

Pinaki

Edited by: Pinaki Mukherjee on Feb 10, 2009 5:56 AM

5 REPLIES 5
Read only

Former Member
0 Likes
1,182

there are different UPDATE statements!


 UPDATE   .... FROM WA
 UPDATE  .... FROM itab
 UPDATE  ... WHERE ...

The last one has the same problems as any SELECT, either is a suitable index or not.

The first two should use the primary key, however, the arrayupdate FROM itab is of course better.

Siegfried

Read only

Former Member
0 Likes
1,182

Hi,

User array operation to UPDATE.

Move all the data the needs to be update to One internal Table.

After that user :

Update from Itab.

Beacuse there will be only One data base hit instead of many.

That will decrease load on DB Server.

Hope this will resolve the issue.

Regards,

Gurpreet

Read only

Former Member
0 Likes
1,183

Hi ,

If you are updating from wark_area ( i.e Update ... from wa ) then it is allways better specify all key fields value in the wark_area.

If you are updating from internal table ( Update ... Table itab ) then it is allways better specify all records of the table in sorted manner.

If in your Update statement having where clause then Try to specify all the key fields left-justifiedly with out any gaps and if it is not possible then provide fields in where clause with-out missing any field .

If you are often using one or more than one same fields ( other than key fields ) , you can create a secondary index with those fields.

Regards

Pinaki

Edited by: Pinaki Mukherjee on Feb 10, 2009 5:56 AM

Read only

Former Member
0 Likes
1,182

hi,

Avoid updating a complete row, use UPDATE+SET statement to update a single field

https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/performance

Please check this link

http://help.sap.com/saphelp_nw04s/helpdata/en/6e/b4fe76e7d311d5995b00508b5d5211/frameset.htm

thanks

Read only

Former Member
0 Likes
1,182

> then it is allways better specify all records of the table in sorted manner.

really, I doubt that it will have any effect.