ERPClimb logoERPClimb
Open SQL
ABAP Developmentadvanced 7 min read

Open SQL Part 8: Performance Analysis with ST05, SAT and SQL Monitor

Preview · a free account unlocks the full lesson

Key takeaway

Find slow SQL with evidence: record an SQL trace in ST05, read the statement summary and explain plan, detect identical selects and missing indexes, profile with SAT, and find system-wide hotspots with the SQL Monitor (SQLM).

In this lessonShow sections

Visual overview

Open SQL Part 8: Performance Analysis with ST05, SAT and SQL Monitor — learning sheetIn one line: Find slow SQL with evidence: record an SQL trace in ST05, read the statement summary and explain plan, detect identical selects and missing indexes, profile with SAT, and find system-wide hotspots with the SQL Monitor (SQLM).ERPClimb.com / ABAP / LESSON 8/10 / LEARNING SHEETOpen SQL Part 8: Performance Analysis with ST05, SAT andSQL Monitor1 · IN ONE LINEFind slow SQL with evidence: record an SQL trace in ST05, read the statement summary andexplain plan, detect identical selects and missing indexes, profile with SAT, and findsystem-wide hotspots with the SQL Monitor (SQLM).2 · KEY IDEAS EXPLAINEDST05 — SQL TraceStatement summary / structure-identicalstatements: groups by SQL text — shows how ofteneach statement ran and total time.Identical selects: exactly the same statement withthe same values executed several times — purewaste (cache the result).What To Look ForOne slow statement with few executions →missing/wrong index, non-selective WHERE, hugeresult.Fast statement executed 50,000 times → SELECTinside a loop → bulk read + internal table.SAT — Runtime AnalysisSAT (formerly SE30) measures the whole program:time per method/statement, split ABAP vs database.Use it when you don't know whether the database is…SQL Monitor (Sqlm)Activated system-wide (production) for a period,it aggregates executions, time and records perstatement and calling code location. Great to find…3 · DO · AVOIDBest practice!Common mistakeTrace with ST05 using realistic data; read thestatement summary.Check identical selects and executions perstatement.Use explain plan for slow single statements.✕Tuning without a trace.✕Tracing with unrealistic tiny selections.✕Only looking at single slow statements, notexecution counts.4 · IN A REAL PROJECTA delivery report was "slow since go-live", and the team planned to add database indexes. An ST05trace showed no slow single statement at all — but 180,000 executions of the same SELECT SINGLE on thecustomer table inside a loop, plus 40,000 identical selects. Replacing them with one bulk read into a hashed…Original ERPClimb learning sheet • Verify against your SAP release and edition

Explanation

Parts 1 through 7 of this series gave rules for writing good SQL; this part is about proving where time is actually spent, both before and after a fix, rather than guessing.

ST05, the SQL trace, records every database statement a user issues: its duration, the rows involved, and how many times it executed. To use it, activate the SQL trace in ST05 for your user (or the job's user), run the program against a small but representative selection, then deactivate and display the trace.

The views worth knowing are the statement summary (structure-identical statements grouped by SQL text, showing how often each one ran and its total time), identical selects (the same statement with the same values executed several times, which is pure waste that should be cached instead), and the explain plan (showing how the database executes the statement — whether it uses an index or falls back to a full scan); trace buffer access and RFC calls too where relevant.

Free account

Create a free account to keep reading

You have read the opening of this lesson. A free ERPClimb account unlocks the rest of it, every other lesson and topic, and your learning history, so you can pick up exactly where you stopped. No card needed.

  • Full explanation
  • Code example
  • Real project scenario
  • Common mistakes
  • Best practices
  • Interview angle

One tap with Google works too. Every topic keeps its first lesson open to everyone.

Keep exploring

Referenced SAP objects

Reviewed reference pages for the objects this page mentions.

Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.