SAP HANA PlanViz and SQL Analyzer for Performance Diagnosis
HANA execution-plan analysis shows how the database actually executes a SQL statement: operators, joins, filters, cardinalities, data movement, parallelism and time or memory hotspots. PlanViz visualizes detailed runtime plans in HANA tooling, while SQL Analyzer/cockpit tools provide modern statement-plan analysis depending on HANA version. Use them after identifying a costly statement with ST05, SQLM or HANA expensive-statement monitoring.
Practitioner guide to SAP HANA PlanViz and SQL Analyzer for Performance Diagnosis, covering architecture, when to use it, operational evidence, decision criteria, common failure modes, S/4HANA context, ownership and production review checkpoints.
Reviewed by an ERPClimb SAP consultant on 20 Sept 2026· 704 words
What it is
An SQL statement is transformed by the HANA optimizer into an executable operator plan. Plan analysis reveals whether filters are pushed early, which join algorithm/order is chosen, where intermediate row counts explode, whether partitions are pruned, whether calculations prevent pushdown, and which operators dominate time/memory. Estimated cardinality can differ from actual runtime cardinality, leading to poor choices. PlanViz captures detailed execution statistics for a statement. SQL Analyzer in current HANA Cockpit/database tooling provides interactive analysis and plan visualization; exact tool naming/UI depends on HANA revision and deployment.
When to use it
Use HANA plan analysis only after a problematic SQL has been isolated. Begin with ST05/SQLM for ABAP-source attribution or HANA expensive statements for database workload, then reproduce the exact SQL with representative parameter values. Use plan evidence when tuning joins, predicates, CDS stack, table functions, partitions or indexes. Do not optimize based solely on SQL text length or developer intuition.
How it fits the stack
ABAP Open SQL/CDS compiles to SQL sent to HANA. ST05 shows the statement and timing from ABAP; PlanViz shows what HANA did internally. Nested CDS, AMDP/table functions and calculated filters can introduce optimization boundaries visible in the plan. Database indexes/partitions affect access operators. SAT measures ABAP CPU but cannot explain an expensive HANA join operator.
A worked example
A CDS report takes 90 seconds only for one company code. ST05 identifies one statement responsible for most DB time. Plan analysis shows a calculated expression prevents an early selective filter and creates a huge intermediate join. The CDS stack is refactored so the filter applies before the calculation; actual intermediate rows collapse and runtime drops. Adding an index would not have fixed the original pushdown boundary.
How to choose
- First identify the expensive SQL and representative bind/parameter values.
- Look for cardinality explosions, late filters, expensive joins/calculations and data movement before proposing indexes.
- Compare estimated versus actual row counts when optimizer choices look surprising.
- Change one design factor at a time and rerun comparable plans.
- Use SAP-supported modeling/API patterns before database-specific hints.
Common pitfalls
- Opening PlanViz for random SQL without proving workload relevance.
- Analyzing a statement with tiny test parameters that do not match production selectivity.
- Focusing on one operator percentage while ignoring repeated execution count at application level.
- Adding hints/indexes before fixing predicates or CDS modeling.
- Assuming the visual plan is stable forever across HANA revisions/statistics/data distribution.
ECC, S/4HANA and clean core
Plan analysis is highly relevant for S/4HANA because custom CDS/Open SQL/AMDP can generate complex HANA plans even when ABAP code is short. Clean-core does not mean performance is automatic; released views can still be consumed inefficiently. Managed cloud deployments may restrict direct DB tooling and provide alternative monitoring/support workflows.
Whose problem this is
HANA performance specialists interpret database plans; ABAP/CDS developers own application query redesign; functional teams provide representative selections/data semantics; Basis controls tracing/production access.
Related SAP objects
Reviewed pages this object connects to in the ERPClimb knowledge graph.
Source: ERPClimb — https://erpclimb.com/sap-technical-topics/sap-hana-planviz-sql-analyzerERPClimb is an independent platform and is not affiliated with SAP SE. Reference pages are written and reviewed by SAP consultants for learning and troubleshooting.