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

Sql Trace

Former Member
0 Likes
556

Hi all,

I am trying to analyze the performance the of sql statement in se38 program. I placed the breakpoint at the select statement. then in another session I activated the trace in st05. After the select statementis executed I deactivated the trace and clicked on analyze trace. I can see list of statements but I do not understand how to find out the runtime of this statement and how expensive it is.

I know how to do it with se30 and tips and tricks. I just wan to know how to do with st05.

I am forwarding the code too.

REPORT ZSELECTDEMO.

tables sflight.

data : itab like sflight occurs 0 with header line.

select * from sflight .

itab-carrid = sflight-carrid.

itab-connid = sflight-connid.

itab-fldate = sflight-fldate.

append itab.

clear itab.

endselect.

loop at itab.

write 😕 itab-carrid,itab-connid,itab-fldate.

endloop.

Please help with this.

Regards,

Varun.

1 ACCEPTED SOLUTION
Read only

manuel_bassani
Contributor
0 Likes
530

Hi varun,

in the list of statements, position the cursor on a SELECT statement (those are native SQL statement!) and click the button Explain. you will see the extimated cost of the statement and the extimated rows extracted.

I think ST05 is very useful if you want yo check which index is used for a given sql statement.

Try to run transaction ST03N. There are runtime and DB statistics for every sql statements

Regards, Manuel

3 REPLIES 3
Read only

manuel_bassani
Contributor
0 Likes
531

Hi varun,

in the list of statements, position the cursor on a SELECT statement (those are native SQL statement!) and click the button Explain. you will see the extimated cost of the statement and the extimated rows extracted.

I think ST05 is very useful if you want yo check which index is used for a given sql statement.

Try to run transaction ST03N. There are runtime and DB statistics for every sql statements

Regards, Manuel

Read only

0 Likes
530

Hi Manuel,

I did the same way you have explained me, I got the result as estimated cost = 1, Estimated # Rows = 81. But what information can I infer from this ? How do I know wether this select statement is epensive or not ?

Regards,

Varun.

Read only

0 Likes
530

Hi,

Those values are estimated from the SQL optimizer (based on DB statistics).

The real execution time is the field "Duration" in the main list.

Regards, Manuel