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 issue when using cursor.

Former Member
0 Likes
924

Dear Friends,

I would like to know that

Using of cursor in abap programming, does it make any issues related to performance and memory management

rather then any normal query ?

also like to know more about internal mechanism.

Avirat

1 ACCEPTED SOLUTION
Read only

volker_borowski2
Active Contributor
0 Likes
880

Well,

using PACKAGE SIZE you can control some of the memory requirements when processing a result set. As far as performance is concerned, there should be no difference, because internally the DB always uses a cursor. The statement is "parsed", which means the DB decides about how to retrieve the resultset in the most efficient way. Then the cursor is opened and the result is fetched.

When you do SELECT / ENDSELECT, you can think of this a a special cursor with a package size of one. When you do a SELECT INTO ITAB, it is a package size of the full result set. So a programmed cursor is somewhat in between, because you can twist the package size.

If you require to use a DB-commit inside a loop, you can use a CURSOR WITH HOLD.

A normal cursor is closed on a commit. This is helpfull in some cases, as far as locks or UNDO resources are concerned.

Volker

6 REPLIES 6
Read only

volker_borowski2
Active Contributor
0 Likes
881

Well,

using PACKAGE SIZE you can control some of the memory requirements when processing a result set. As far as performance is concerned, there should be no difference, because internally the DB always uses a cursor. The statement is "parsed", which means the DB decides about how to retrieve the resultset in the most efficient way. Then the cursor is opened and the result is fetched.

When you do SELECT / ENDSELECT, you can think of this a a special cursor with a package size of one. When you do a SELECT INTO ITAB, it is a package size of the full result set. So a programmed cursor is somewhat in between, because you can twist the package size.

If you require to use a DB-commit inside a loop, you can use a CURSOR WITH HOLD.

A normal cursor is closed on a commit. This is helpfull in some cases, as far as locks or UNDO resources are concerned.

Volker

Read only

0 Likes
880

Thank you Volker,

appreciate your answer.

but require more knowledge in depth if you have any resource .

Avirat

Read only

0 Likes
880

More knowledge about

- programming cursors in ABAP

or

- how cursors are processed by the DB

??

I guess you already did search help.sap.com for information like this ?

http://help.sap.com/saphelp_nw04/helpdata/EN/fc/eb3b23358411d1829f0000e829fbfe/content.htm

Volker

Read only

0 Likes
880

ohh..

I have done this before (with the same link).

need to know about 2nd op.

ok anyway..

thank for your help.

Avirat

Read only

0 Likes
880

There might be slight technical differences depending on your DB type.

So I'd recommend to do a google search i.e. with

"cursor processing oracle" or "db2", or ...

depending on the DB you are running.

Volker

Read only

0 Likes
880

ok

Thanks Volker , i will do that.

Avirat