technicaladvancedChapter 6 / 21 · Lesson 2 / 3
Performance tracing, SQL and HANA analysis — Guided debugger and evidence walkthrough
Prove the bottleneck using traces before proposing code or index changes.
Approx. 25 minutes · Guided practice + knowledge check
This guided walkthrough 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.
01Set up a safe diagnostic reproduction
ABAP Open SQL and CDS/HANA landscapes; SQL Monitor, SAT/ST05 and HANA plan access require authorized trace scope. Use fictional keys and DEV/QA data. The expected outcome is: Prove the bottleneck using traces before proposing code or index changes.
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
02Animated investigation walkthrough
Choose any step or play the trace. The highlighted evidence and explanation change for this exact chapter. This is a teaching simulation, not a SAP GUI recording.
Active diagnostic action
Define the exact measured report variant, client, user and representative dataset; capture outputs and elapsed time.
One item SELECT per order explains 1500 DB executions and substantial cumulative duration.
Check alternative: An N+1 access pattern causes most cumulative database time.
Complete six-step runbook for this chapter
- 01 Scope.Define the exact measured report variant, client, user and representative dataset; capture outputs and elapsed time.
- 02 Find source.Run a scoped ST05 SQL trace and SAT analysis; record top statements by cumulative duration and execution count.
- 03 Inspect.Identify the repeated VBAP lookup inside the order loop and verify that the trace corresponds to the relevant code.
- 04 Test cause.Design a set-based Open SQL retrieval or validated join that preserves item-level filtering and authorization checks.
- 05 Correct safely.Re-run on matching data with controlled cache/time windows; compare DB requests, total runtime and memory.
- 06 Verify.Diff resulting document keys, item counts and totals; keep a regression for customer/plant/authorization-filtered variants.
03Read the three decisive observations
- 1.One item SELECT per order explains 1500 DB executions and substantial cumulative duration.
- 2.The single header lookup is not the bottleneck, even if its statement looks complex.
- 3.A set-based query can reduce round trips but may increase memory or change join semantics.
04Safe handoff and completion criteria
Limit performance traces to approved users/time windows. Never disable authorization, SQL client filters or productive indexes without DBA/change review.
- Positive case.Same 1500 headers and 7800 item rows returned with identical business totals.
- Negative case.A restricted-role user sees only permitted orders; the optimization doesn't leak client data.
- Cross-process check.Repeated 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.