Application Development 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: 

Program performance

kanishakgupta1
Contributor
0 Kudos

Hi,

I am running the program XYZ in Background.It takes me 30 minutes to get the output.Whne i run the program second time but with the diffrent selection parameters,it only takes 3 minutes to complete the program.

the data content selected for the program is same.The program accesses the data from 2 tables which doesnot have index.

Kindly help me finding out the reason for the same.

kanishak

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Your question isn't clear to me. You say you are using different selection criteria for the second run and are asking why it runs more quickly. Is that correct?

If so, you should post the SELECT statement, the parameters and how they are completed for each run.

That will save the people who are trying to help some time.

Rob

11 REPLIES 11

Former Member
0 Kudos

Hi,

the best way is to set an index to this tables and to select over the key-fields.

Which tables do you use and how is your selection?

regards

Nicole

SuhaSaha
Advisor
Advisor
0 Kudos

Hello,

You must be aware of table buffers. In the second run, the data is selected from the table buffer and not directly from the database level. Hence the difference.

If you let us know the tables, then may be we can explain in a better way. Please check in the technical settings of the table if the "Buffering Switched On" is checked.

BR,

Suhas

Former Member
0 Kudos

Hi,

This is because of the table buffering concepts.

What happens if the table is a buffered table the contents gets stored in the application server for a period of time.

So in the second select it does not hve to hit the data base again. insted it gets thev alues from the application server itself and hence it is faster.

Regards

Ansari

former_member192616
Active Contributor
0 Kudos

Hi,

>

> Kindly help me finding out the reason for the same.

> kanishak

the reason is most likely caching.

You can get the STAD records for both exectutions and compare the

database part, see example below. In transaction STAD set appropriate

filters for USER, Programm/Transaction, and very importand start time and

interval that should be read from the STAD records.


Analysis of ABAP/4 database requests (only explicitly by application)

 Connection                    DEFAULT         Request time           540 ms
 Database requests total         2,011         Commit time              0 ms
 DB Proc. Calls                      0         DB Proc. Time            0 ms

 Type of          Database           Requests   Database   Request  Avg.time /
 ABAP request         rows  Requests to buffer     calls  time (ms)  row (ms)

 Total               4,194    2,011        863       938       540       0.1

 Direct read            65    1,116        801                  29       0.4
 Sequential read     4,129      895         62       938       511       0.1
 Update                  0        0                    0         0       0.0
 Delete                  0        0                    0         0       0.0
 Insert                  0        0                    0         0       0.0

you can compare the rows and the time values in order to find out

the differences.

Kind regards,

Hermann

kanishakgupta1
Contributor
0 Kudos

Hi all,

Do u mean to say that whole table is buffred once the selection query is applied on that table the table i m using is BSIS,RESB,BKPF.

I cannot use index and i need not to improve the performace .i just want to know why there is a large time diffrence when i run the programs.

I dnt have buffring active for these tables

regards

kanishak

Edited by: Kanishak Gupta on Sep 9, 2009 3:13 PM

0 Kudos

Hello,

If you check the "technical settings" for the tables BSIS,RESB,BKPF none of them have the "buffering" radio button turned on. So the table entries which were accessed will not be buffered at all.

Do an F1 on these screen fields & read SAP documentation.

What are the tables which you are working ?

Hope i am clear.

BR,

Suhas

0 Kudos

Hi Suhas,

All the tabes i have used doesnot have buffring on.This means that the data for these tables is not buffred......

then why the program takes lesser time when executed for the second time........

kanishak

0 Kudos

Hi,

>

> Do u mean to say that whole table is buffred once the selection query is applied on that table the table i m using is BSIS,RESB,BKPF.

don't confuse SAP table buffers and Database cache (some call it buffer as well).

The SAP table buffers can influence it too but normally the effect is not as big as the database cache.

During your first execution the blocks (pages) of your tables are probably read physically from disk

since they are not in the database cache. Your second execution finds these blocks (pages) already cached.

From an ABAP program perspective this behaviour (caching in the database) can not be changed (only with

some database specific hints). The only thing you can do is to try to minimize the I/O as far as possible

and hope for a large cache that can hold your needed blocks (pages) long enough...

Kind regards,

Hermann

0 Kudos

I have used Database hints in the program

0 Kudos

Hi,

>

> I have used Database hints in the program

so: what hint have you used?

You didn't use one that influences the caching behaviour of the database, did you?

So far i don't see what your question is. The different program run time is most likely

caused by caching in the databse. There is not much you can do regarding caching.

You can only try to read as few blocks as possible (fiellist, where condition, indexes).

Kind regards,

Hermann

Former Member
0 Kudos

Your question isn't clear to me. You say you are using different selection criteria for the second run and are asking why it runs more quickly. Is that correct?

If so, you should post the SELECT statement, the parameters and how they are completed for each run.

That will save the people who are trying to help some time.

Rob