technicaladvancedChapter 6 / 21 · Lesson 3 / 3
Performance tracing, SQL and HANA analysis — Root-cause case, remediation and assessment
Prove the bottleneck using traces before proposing code or index changes.
Approx. 30 minutes · Guided practice + knowledge check
This incident case covers “Performance tracing, SQL and HANA analysis”, a advanced technical troubleshooting topic. The symptom it starts from: An ABAP report is slow or data appears incorrect after query optimization. It follows a 3-phase evidence flow and a six-step runbook, references 5 tools (ST05, SAT, ST12 (where available), SQL Monitor, Plan analysis) and ends with a self-check question. All system data in the examples is fictional.
01Incident briefing: identify what really failed
An ABAP report is slow or data appears incorrect after query optimization. You are investigating a fictional case; the task is to prove which boundary is responsible without damaging business state.
Synthetic ST05 extract: SELECT VBAK ... executions=1, duration=12ms SELECT VBAP WHERE VBELN=? ... executions=1500, total=6600ms Application runtime=7200ms, DB=6900ms Order count=1500; item rows expected=7800
02Separate facts from competing hypotheses
- EVIDENCE 1One item SELECT per order explains 1500 DB executions and substantial cumulative duration.
- EVIDENCE 2The single header lookup is not the bottleneck, even if its statement looks complex.
- EVIDENCE 3A set-based query can reduce round trips but may increase memory or change join semantics.
Which explanation is best supported by this evidence?
03Investigation runbook
- 01Define the exact measured report variant, client, user and representative dataset; capture outputs and elapsed time.
- 02Run a scoped ST05 SQL trace and SAT analysis; record top statements by cumulative duration and execution count.
- 03Identify the repeated VBAP lookup inside the order loop and verify that the trace corresponds to the relevant code.
- 04Design a set-based Open SQL retrieval or validated join that preserves item-level filtering and authorization checks.
- 05Re-run on matching data with controlled cache/time windows; compare DB requests, total runtime and memory.
- 06Diff resulting document keys, item counts and totals; keep a regression for customer/plant/authorization-filtered variants.
04Proof of a durable resolution
Limit performance traces to approved users/time windows. Never disable authorization, SQL client filters or productive indexes without DBA/change review.
- Positive caseSame 1500 headers and 7800 item rows returned with identical business totals.
- Negative caseA restricted-role user sees only permitted orders; the optimization doesn't leak client data.
- Cross-process checkRepeated runs demonstrate reduced cumulative DB time without excessive memory use.
05Check your diagnosis
A report runs 1500 identical item queries inside a loop. What is a likely first optimization hypothesis?
Select an answer to see the reasoning. This self-check is not a certification examination.
06Continue studying this SAP issue
The links below preserve the original published ERPClimb lessons in their own technical/functional modules. They supplement, not duplicate, this 22nd-module teaching page.
- Performance Part 1: Measuring with ST05, SAT and STAD
- Open SQL Part 8: Performance Analysis with ST05, SAT and SQL Monitor
- CDS Table Functions Part 4: Performance with HANA Plan Analysis
Additional officially documented tools: SAP Learning — ABAP debugging. Confirm the documentation version for your system.