
STATS
and STATS_FE
help you to detect performance bugs in your applications, and I state that ST05
is an essential analysis tool to find root causes for applications that are too slow or consume too many resources. In particular, ST05
captures requests and data transmissions between the ABAP work process and external components. By default these transmissions are not recorded to not incur the associated overhead. You need to consciously and explicitly activate the recording, and subsequently must switch it off. Once you have a high quality trace of your application's communication with external resources, you want to evaluate it in the most efficient way.Figure 1: In the chronologically sorted list of Trace Main Records, each entry corresponds to one execution of an ABAP statement calling an external resource, or to the processing of an incoming request.
To remedy these shortcomings,ST05
offers various options to summarize the list of Trace Main Records, which make your work with previously recorded traces much more efficient. They are all accessible from the drop-down menu of button Aggregate Trace . Table 1 briefly introduces them, and the following sections describe them in detail.
Structure-Identical Statements | Specific values of bind variables are not considered. |
Value-Identical Statements | Structure-identical statements where the bind variables have the same values. |
Table Accesses | Database accesses from the same category (SELECT , INSERT , UPDATE , DELETE , ...) grouped by object and by database connection.Buffer accesses using the same number of key fields. (Only for trace types SQL, BUF.) |
Trace Overview | Quality control of the trace, break-down of records by type, and high-level evaluation with hints for potential optimizations. |
Sizing Information | Estimates the data volume added by the traced application to the database. |
Trace Single Records | Resolves individual low-level operations. (They are recorded only for trace types SQL, BUF.) |
Figure 2: The list of Structure-Identical Statements summarizes the Trace Main Records for statements with the same structure, but potentially distinct values for bind variables. The list is sorted descending by Duration.
Executions | Total number of executions of the structure-identical statements. |
Redundancy | Absolute number of redundant value-identical statements. |
Identical | Relative number of redundant value-identical statements. |
Duration | Total elapsed execution time in µs of the structure-identical statements. (Measured by the ABAP work process.) |
CPU Time | Total HANA CPU time in µs used during the structure-identical statements' executions. (Only for SQL trace records on SAP HANA.) (Measured by the SAP HANA DB server.) |
Memory | Maximum memory consumption in kByte during the structure-identical statements' executions. (Only for SQL trace records on SAP HANA.) (Measured by the SAP HANA DB server.) |
Records | Total number of records affected by the structure-identical statements. (SQL, BUF: number of table or view rows; ENQ: number of lock granules) (Not for RFC, HTTP, APC, and AMC trace records.) |
Duration / Execution | Average execution time in µs per contributing statement. |
Records / Execution | Average number of records affected per contributing statement. |
Duration / Record | Average execution time in µs per record. (Records = 0 ⇒ average execution time per contributing statement.) |
Min. Duration / Record | Minimum execution time in µs per record. (Records = 0 ⇒ minimum execution time of contributing statements.) |
Length | ABAP dictionary record length in Byte of the table or view. (Only for SQL and BUF trace records.) |
Buffer Type | Buffer type of the table or view. (Only for SQL and BUF trace records.) |
Table Type | Table type of the table or view. (Only for SQL and BUF trace records.) |
Data Class | Type of data stored in the table. (Only for SQL and BUF trace records.) |
Size | Estimated size category of the table. (Only for SQL and BUF trace records.) |
Object Name | Name of the object that was accessed. (SQL, BUF: table or view; ENQ: lock object; RFC: function; HTTP, APC: path; AMC: channel ID) |
Statement | Edited statement. (SQL: field list and FROM clause removed, variable names as place holders for values;BUF: buffer type, length of key values in characters, buffer operation; ENQ: lock operation, lock mode, table, granule argument; RFC: source, destination, CLIENT or SERVER , function, sent data in Byte;HTTP: method, status code, status text, scheme, host, port, CLIENT or SERVER , path;APC: executed action, protocol, host, port, CLIENT or SERVER , path;AMC: <empty>) |
SELECT
s, or 50,000 µs = 50 ms for INSERT
s, UPDATE
s, or DELETE
s, the statement's execution on the database is slow and shall be investigated in detail. If a statement has been executed multiple times (e.g., Executions ≥ 10), also consider the value of average Duration / Record. With few executions, a single outlier may distort the average, i.e., one slow execution may conceal several fast executions, but with 10 or more executions, it should be reliable and taken seriously. In my blog post Analyze Individual Trace Records, I explain how you can recognize the database's processing of a slow statement and how this may indicate optimization approaches.FUL
, GEN
, or SNG
indicate that the table buffer was bypassed, which slows down the application, puts unnecessary load on the database server, and does not take advantage of the application server memory used to buffer the table's rows. Rewrite the corresponding statements so that they can be handled by the table buffer. Values in the Buffer Type column starting with DE
represent the technical setting Buffering allowed but switched off. Check whether buffering can be switched on for the affected tables. The Buffer Type CUST
identifies accesses to unbuffered customizing tables (Data Class = APPL2
). Consider to switch on buffering for the table—this is typically suitable for customizing data. Finally, the entry DDIC
in the Buffer Type column indicates direct accesses to tables belonging to the ABAP dictionary. Replace them by using functions DDIF*
, in particular DDIF_NAMETAB_GET
or DDIF_FIELDINFO_GET
.WHERE
clause as restrictive as possible, and does the field list request only necessary columns?The list of Value-Identical Statements (Fig. 3) also summarizes identical Trace Main Records, but unlike the Structure-Identical Statements, it takes the concrete values for any bind variables into account. This aggregation supports only SQL, BUF, and ENQ trace records. These are the only trace types where values are recorded. The columns in the list of Value-Identical Statements are mostly like the ones for the Structure-Identical Statements. Table 3 contains the differences.
Figure 3: The list of Value-Identical Statements summarizes Trace Main Records for statements with the same structure, and with identical values for bind variables. The list is sorted descending by Duration.
Executions | Total number of executions of the value-identical statements. |
Redundancy | Not available—covered by Executions. |
Identical | Not available—covered by Executions. |
Statement | Edited statement. (SQL: field list and FROM clause removed, variable values;BUF: buffer type, length of key values in characters, key values; ENQ: lock operation, lock mode, table, granule argument) |
ST05
(nor in any other tool) to find all superfluous SQL statements.SELECT
, INSERT
, UPDATE
, DELETE
) that access a table or view over the same logical database connection. Similarly, all BUF trace records triggered by statements that were handled by the table buffer or by other buffers on the application server instance, and that access an object with the same number of key fields are aggregated. No other trace types are supported by this aggregation option. Table 4 contains the fields displayed in the Table Accesses list.Figure 4: The list of Table Accesses summarizes, separately for each table or view, all statements of the same category. The sort order is alphabetically by Object Name, Statement category, and Connection Name.
Object Name | Name of the table or view that was accessed. |
Length | ABAP dictionary record length in Byte of the table or view. |
Buffer Type | Buffer type of the table or view. |
Table Type | Table type of the table or view. |
Data Class | Type of data stored in the table. |
Size | Estimated size category of the table. |
Statement | Category of statement SQL: SELECT , INSERT , UPDATE , DELETE , ...BUF: buffer type, key length |
Connection Name | Name of the logical database connection used by the contributing statements. |
Duration | Total elapsed execution time in µs of the contributing statements. (Measured by the ABAP work process.) |
CPU Time | Total HANA CPU time in µs used during the contributing statements' executions. (Only for SQL trace records on SAP HANA.) (Measured by the SAP HANA DB server.) |
Memory | Maximum memory consumption in kByte during the contributing statements' executions. (Only for SQL trace records on SAP HANA.) (Measured by the SAP HANA DB server.) |
Records | Total number of table or view rows affected by the contributing statements. |
Executions | Total number of executions of contributing statements. |
Button Component Hierarchy enhances the list of the Table Accesses (Fig. 5). It groups the accessed tables by their application component (levels 0 and 1 are supported, level 0 is the default, buttons
or
toggle between the levels), and additionally shows the tables’ short descriptions from the ABAP data dictionary. For each application component, absolute and relative subtotals of the duration, the number of records, and the number of executions are given separately for the statement categories (
SELECT
, INSERT
, UPDATE
, DELETE
; buffer accesses), and across all categories.
Figure 5: The Application Component Hierarchy view augments the list of Table Accesses (Fig. 4) by including the tables' application components and descriptions. With this additional information you can better understand why the tables are accessed when the application executes. The grouping by application component helps you to judge the run time contributions of the components.
Figure 6: The Trace Overview evaluates the trace's technical quality, and identifies performance bugs.
ROLLBACK
s, OPEN
operations, or SQL statements that load content into the table buffer on the application server instance, you have not executed enough pre-runs of your application before recording the trace. The Trace Overview then advises you to Consider re-recording the trace. Before doing so, execute the application several times. Typically, you want to analyze and eventually optimize the repeated executions of your applications. For them, there should not be any ROLLBACK
s. Also, all SQL statements should already be in the database server’s statement cache so that no OPEN
operation is needed, and the table buffer should contain all necessary rows.SELECT
s for buffered tables or redundant DB accesses. Additionally, the SQL trace records are checked by Code Inspector to find statements whose access times to the persistence may erroneously depend on the amount of data persisted. This is typically a consequence of inadequate index support. INSERT
s, DELETE
s, and MODIFY
s. It estimates the impact of the corresponding SQL statements recorded in the trace on the data volume stored in the database. This provides important input for correctly sizing the storage capacity of the production system landscapes where the application will be executed.Figure 7: The Sizing Information calculates rough estimates for the change of the data volume stored in the database caused by the statements recorded in the trace. Uncertainties are produced by not knowing whether MODIFY
s have added new rows or changed existing rows. Another source of uncertainty is related to table fields of types whose sizes are not statically predetermined.
INSERT
s, MODIFY
s, and DELETE
s per Table alphabetically lists the database tables affected by INSERT
, DELETE
, or MODIFY
statements, and shows the numbers of rows affected by statements in these categories. Because a MODIFY
can either insert new rows into a database table or update existing rows, two values per table are calculated for the overall net number of changed rows: The difference of INSERT
s and DELETE
s considers all MODIFY
s as updates of existing rows. This is a lower limit for the net number of rows created by the application. The opposite approach treats all MODIFY
s as if they insert new rows: It uses the sum of INSERT
s and MODIFY
s minus the DELETE
s to obtain an upper limit for the net number of new rows in each table. The Sizing Information does not consider UPDATE
s because they never add rows to a database table.LRAW
(X
in column LRAW) or of types STRING
, RAWSTRING
, or TEXT
(X
in column VAR). The size of the content of these fields is not known statically and taken to be 0, acting as a lower limit. Finally, this area contains the tables' descriptions from the ABAP data dictionary.So far, this blog post was all about aggregating several Trace Main Records that share some common properties. But you can also move in the opposite direction. For trace types SQL and BUF, the Trace Main Records are already combinations of individual Trace Single Records, which represent low-level operations involved in the processing of the database or buffer accesses. From the list of Trace Main Records, button Display Individual Records takes you to the Trace Single Records (Fig. 8). Table 5 explains the columns that are not in the Trace Main Records.
Figure 8: The chronologically sorted list of Trace Single Records shows the individual trace records without any aggregation. The three selected entries contribute to the processing of one SQL statement, and are combined into one Trace Main Record with the Start Time of the first entry (cf. Fig. 1).
Instance Name | Application server instance where the statement was triggered. |
Operation | Operation that was executed. (RFC, HTTP: Client or Server ;APC: executed action, protocol, path, port, sent and received data in Byte) |
Return Code | Return code of the executed operation. |
ST05
greatly improve its capabilities to analyze traces in an efficient way.You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
27 | |
12 | |
12 | |
11 | |
10 | |
9 | |
9 | |
7 | |
7 | |
7 |