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

ST05 doubts

former_member425121
Participant
0 Likes
844

Hi

I executed the Trace (ST05) for a program. when i see the 'Summarized SQL Statements: Sorted by Duration' i see the corresponding columns (Executions, Identical, Duration, etc.) for each SELECT.

But somebody can help with two doubts:

- Why in 'Executions' column i have a value of 436 for some SELECT but that Select statement is only executed one time (i set a breakpoint) ?

- The 'Duration' column is affected by the work-load of the server ? that is, if i run a trace for a program twice, this give me different results. Then how can i be sure , if i modificate the program, that i really improve the Selects ?

Thanks in advanced

Frank

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
807

The number of executions is affected by the way you are doing the select: SELECT SINGLE;SELECT/ENDSELECT;SELECT...FOR ALL ENTRIES.

The duration column is indeed affected by running it more than once. there is some buffering going on that will reduce the execution time for subsequent SELECTs of the same data. You can ease this by running the program without ST05 and then running it again with ST05 so that all SELECTs will be bufferred. A better way is to examine the "explain" of the SELECT in ST05. But this will be affected by the number of executions.

Rob

9 REPLIES 9
Read only

Former Member
0 Likes
807

1. Duration figure is the runtime for the statement in the format milliseconds/microseconds.

2. When you improve or enhance SELECT statement, you can find the difference in the Runtime figure.

For more info, refer below link:

http://help.sap.com/saphelp_nw04/helpdata/en/d1/801f89454211d189710000e8322d00/frameset.htm

Thanks,

Santosh

Read only

Former Member
0 Likes
808

The number of executions is affected by the way you are doing the select: SELECT SINGLE;SELECT/ENDSELECT;SELECT...FOR ALL ENTRIES.

The duration column is indeed affected by running it more than once. there is some buffering going on that will reduce the execution time for subsequent SELECTs of the same data. You can ease this by running the program without ST05 and then running it again with ST05 so that all SELECTs will be bufferred. A better way is to examine the "explain" of the SELECT in ST05. But this will be affected by the number of executions.

Rob

Read only

0 Likes
807

Thanks Rob

But , then, the 'Executions' is not the number of times wich a SELECT was executed ?

For example, i have two Selects i a program, both are executed only ONE time per execution:

a) SELECT *

FROM t179t

INTO TABLE i_prodh

WHERE spras EQ sy-langu.

b) SELECT vbeln

posnr

kunnr

parvw

FROM vbpa

INTO TABLE i_vbpa

FOR ALL ENTRIES IN i_vbap

WHERE vbeln EQ i_vbap-vbeln

AND parvw IN ('RE','ZS').

It's a sure fact that both selects are executed only One time; then why in the trace (ST05) the 'Execution' column has a value '1' for the first select; but it has a value of '436' for the second place ?

Can somebody help me please to understand this ?

Regards

Frank

Read only

0 Likes
806

What is your database system?

do you have 436 entries in i_vbap?

Rob

Message was edited by:

Rob Burbank

Read only

0 Likes
806

When you user FOR ALL ENTRIES, your SELECT statement will get executed as many times as number of rows in your internal table

Read only

0 Likes
806

Well, the ABAP SELECT statement will just be executed once, but it will be translated into something different when it goes to the database. It looks like it is going to the actual database once for each entry in the internal table, but I've also seen it grouped so that it only goes once for the entire table.

I don't worry about the details. Like I said in an earlier post, run it twice and look at the execution times of the second run.

Rob

Read only

0 Likes
806

In the table used for the FOR ALL ENTRIES , that is, i_vbap , i have 2,182 records. In the resulting filled table (i_vbpa) i get 2,481 records.

And in the Executions column, 436.

Read only

0 Likes
806

Thanks...

Read only

Former Member
0 Likes
806

If you look at the ST05 trace of a for-all-entries selection, you'll notice that the select-statement is internally broken up into pieces, and a chunk of records, say 5 or 10, are exeucted in each where-clause. This is why, when you have 1-2k records in your itab, the for-all-entries selection gets executed some 400+ times.