Collected information belongs to the topics of query execution and optimization in SAP HANA database

Estimated read time 9 min read

last updated: 2025-06-11

Introduction
There is huge knowledge available about SAP HANA query execution topic (incl. parsing / optimization / plans / engines / hints / etc.),  but the knowledge is very fragmented (Help Portal, Blog post, SAP KBA, SAP Note, SAP Learning, other). The aim of this article is simplify and make content consumption easier with a centralized page. There is no reason to duplicate the already well prepared content, so the goal is to collect the available knowledge and put it in a well structured format. The logic of the page follows the earlier published articles in the same series.

What is SAP HANA?

Table of Content (The internal links had been removed cause the new blogging platform only supports basic html, and the use of anchor links not supported.) 

DefinitionsWhere to find documentations in SAP Help Portal?Which are the master SAP Knowledge Base Articles?Which are the related SAP Knowledge Base Articles?Where to find learning materials?Concept of the SAP HANA query executionWhich SAP HANA execution engines exist?Which SQL Statement Collection report can be used for monitoring query execution?Which other documents belongs to SAP HANA Execution Engine (HEX) and why is this particularly important?Which other documents belongs to hints?Which other documents belongs to plans?Other articles in this seriesOther articles in connected seriesUseful bookmark

Definitions
To put the topic in context we need to understand general terms and meanings correctly.

Query: A query is a question or inquiry about a set of data. We use Structured Query Language (SQL) to retrieve meaningful and relevant information from databases.Query Compilation / “Query Preparation”: The set of sequences to parse, check, optimize, and generate a plan is called query compilation.Query Execution:  Query execution in a database involves a user submitting a query, which is then processed by the database engine to retrieve the requested data. This process includes several internal steps, such as parsing, optimization, and ultimately, the execution of a physical plan. Statement / Statement String / Statement Hash3588199 – Overview of the “statement string” / “statement hash” in the context of SAP HANA database?

IMPORTANT !
=================================================================

Where to find documentations in SAP Help Portal?

SAP HANA Performance Guide for Developers – SQL Process

Which are the master SAP Knowledge Base Articles?

2124112 – FAQ: SAP HANA Parsing2000002 – FAQ: SAP HANA SQL Optimization

Which are the related SAP Knowledge Base Articles?

2142945 – FAQ: SAP HANA Hints2400006 – FAQ: SAP HANA Statement Hints2570371 – FAQ: SAP HANA Execution Engine (HEX)2599949 – FAQ: SAP HANA Extended SQL Executor (ESX)

Where to find learning materials?

SAP Learning – A First Step Towards SAP HANA Query Optimization

=================================================================

Concept of the SAP HANA query execution
The below image shows the current SAP HANA query execution steps, logic in order. The following scenarios can occur:

Plan cache entry not foundPlan cache entry found

Image source:  SAP Learning – A First Step Towards SAP HANA Query Optimization

Which SAP HANA execution engines exist?

SAP HANA Performance Guide for Developers – Query Execution Engine Overview2000002 – FAQ: SAP HANA SQL Optimization – – > 37. Which SAP HANA execution engines exist?

Which SQL Statement Collection report can be used for monitoring query execution?

1969700 – SQL Statement Collection for SAP HANA3327150 – SQL Statement Collection: “HANA_SQL_StatementHash_DataCollector” report for SAP HANA

Which other documents belongs to SAP HANA Execution Engine (HEX) and why is this particularly important?
HEX is a new SQL engine in HANA that is designed to replace other engines. The SQL optimizer in HANA prioritizes HEX plans over plans from old engines if the query can be executed by HEX. The optimizer does not directly compare HEX plans and old engine plans because HEX offers wider functionality and generally performs better with lower memory consumption. However, there may be cases where HEX shows worse performance.

2847700 – How-to: Circumventing the HEX Engine in Specific Cases3326981 – Why HEX Plans fallback to old engines such as Join, OLAP, ESX

Which other documents belongs to hints?

2700051 – Delivery of SAP HANA Statement Hints3079964 – When to apply hints and why are they needed (internal)3556465 – How to apply hint on statement level in SAP HANA?2509161 – Set SQL Execution Hints in the Graphical Calculation View on the Model Level3019087 – How to Apply HINTS / Calculation Engine Settings for Queries Against Calculation Views

Which other documents belongs to plans?

2222321 – How-To: Pinning SAP HANA SQL Plans

Other articles in this series

✍️ Collected information about memory in context of SAP HANA
✍️ Collected information regarding partitioning in SAP HANA (with examples)
✍️ Collected information regarding High Availability and Disaster Recovery in SAP HANA
✍️ Collected information about reclaim / shrink / defragmentation topic in context of SAP HANA persiste…

Other articles in connected series

✍️ Where can I find knowledge and information belongs to SAP HANA?
✍️ Where can I find information about the available tools for SAP HANA (all types of use)?

Useful bookmark

🔖 2872774 – Bookmark of Frequently Asked Questions for SAP HANA
🔖 3311408 – Bookmark of SQL Statement Collection reports for SAP HANA
🔖 2658020 – List of SAP HANA SQL Error Codes

Release Information

Release DateDescription2025.06.11First/initial Release of the SAP Blog Post documentation (Technical Article).

 

 

​ last updated: 2025-06-11IntroductionThere is huge knowledge available about SAP HANA query execution topic (incl. parsing / optimization / plans / engines / hints / etc.),  but the knowledge is very fragmented (Help Portal, Blog post, SAP KBA, SAP Note, SAP Learning, other). The aim of this article is simplify and make content consumption easier with a centralized page. There is no reason to duplicate the already well prepared content, so the goal is to collect the available knowledge and put it in a well structured format. The logic of the page follows the earlier published articles in the same series.What is SAP HANA?Table of Content (The internal links had been removed cause the new blogging platform only supports basic html, and the use of anchor links not supported.) DefinitionsWhere to find documentations in SAP Help Portal?Which are the master SAP Knowledge Base Articles?Which are the related SAP Knowledge Base Articles?Where to find learning materials?Concept of the SAP HANA query executionWhich SAP HANA execution engines exist?Which SQL Statement Collection report can be used for monitoring query execution?Which other documents belongs to SAP HANA Execution Engine (HEX) and why is this particularly important?Which other documents belongs to hints?Which other documents belongs to plans?Other articles in this seriesOther articles in connected seriesUseful bookmarkDefinitionsTo put the topic in context we need to understand general terms and meanings correctly.Query: A query is a question or inquiry about a set of data. We use Structured Query Language (SQL) to retrieve meaningful and relevant information from databases.Query Compilation / “Query Preparation”: The set of sequences to parse, check, optimize, and generate a plan is called query compilation.Query Execution:  Query execution in a database involves a user submitting a query, which is then processed by the database engine to retrieve the requested data. This process includes several internal steps, such as parsing, optimization, and ultimately, the execution of a physical plan. Statement / Statement String / Statement Hash: 3588199 – Overview of the “statement string” / “statement hash” in the context of SAP HANA database?IMPORTANT !=================================================================Where to find documentations in SAP Help Portal?SAP HANA Performance Guide for Developers – SQL ProcessWhich are the master SAP Knowledge Base Articles?2124112 – FAQ: SAP HANA Parsing2000002 – FAQ: SAP HANA SQL OptimizationWhich are the related SAP Knowledge Base Articles?2142945 – FAQ: SAP HANA Hints2400006 – FAQ: SAP HANA Statement Hints2570371 – FAQ: SAP HANA Execution Engine (HEX)2599949 – FAQ: SAP HANA Extended SQL Executor (ESX)Where to find learning materials?SAP Learning – A First Step Towards SAP HANA Query Optimization=================================================================Concept of the SAP HANA query executionThe below image shows the current SAP HANA query execution steps, logic in order. The following scenarios can occur:Plan cache entry not foundPlan cache entry foundImage source:  SAP Learning – A First Step Towards SAP HANA Query OptimizationWhich SAP HANA execution engines exist?SAP HANA Performance Guide for Developers – Query Execution Engine Overview2000002 – FAQ: SAP HANA SQL Optimization – – > 37. Which SAP HANA execution engines exist?Which SQL Statement Collection report can be used for monitoring query execution?1969700 – SQL Statement Collection for SAP HANA3327150 – SQL Statement Collection: “HANA_SQL_StatementHash_DataCollector” report for SAP HANAWhich other documents belongs to SAP HANA Execution Engine (HEX) and why is this particularly important?HEX is a new SQL engine in HANA that is designed to replace other engines. The SQL optimizer in HANA prioritizes HEX plans over plans from old engines if the query can be executed by HEX. The optimizer does not directly compare HEX plans and old engine plans because HEX offers wider functionality and generally performs better with lower memory consumption. However, there may be cases where HEX shows worse performance.2847700 – How-to: Circumventing the HEX Engine in Specific Cases3326981 – Why HEX Plans fallback to old engines such as Join, OLAP, ESXWhich other documents belongs to hints?2700051 – Delivery of SAP HANA Statement Hints3079964 – When to apply hints and why are they needed (internal)3556465 – How to apply hint on statement level in SAP HANA?2509161 – Set SQL Execution Hints in the Graphical Calculation View on the Model Level3019087 – How to Apply HINTS / Calculation Engine Settings for Queries Against Calculation ViewsWhich other documents belongs to plans?2222321 – How-To: Pinning SAP HANA SQL PlansOther articles in this series✍️ Collected information about memory in context of SAP HANA✍️ Collected information regarding partitioning in SAP HANA (with examples)✍️ Collected information regarding High Availability and Disaster Recovery in SAP HANA✍️ Collected information about reclaim / shrink / defragmentation topic in context of SAP HANA persiste…Other articles in connected series✍️ Where can I find knowledge and information belongs to SAP HANA?✍️ Where can I find information about the available tools for SAP HANA (all types of use)?Useful bookmark🔖 2872774 – Bookmark of Frequently Asked Questions for SAP HANA🔖 3311408 – Bookmark of SQL Statement Collection reports for SAP HANA🔖 2658020 – List of SAP HANA SQL Error CodesRelease InformationRelease DateDescription2025.06.11First/initial Release of the SAP Blog Post documentation (Technical Article).    Read More Technology Blog Posts by SAP articles 

#SAP

#SAPTechnologyblog

You May Also Like

More From Author