Optimizing view performance is often a tricky business. As data models become increasingly complex, it becomes more and more difficult to keep track of the efficiency of all the views involved. This is exactly where the new SAP Datasphere function for runtime metrics, which we will introduce in this article, comes in.
We will show you how you can effectively monitor the performance of your views and keep an eye on critical metrics such as runtime, memory consumption, and the number of processed data records. You will also learn how to create PlanViz files for visual evaluation. This allows you to detect performance problems early on and identify optimization potential.
Our blog series "SQLScript Performance Analysis" at a glance: |
1. Performance analysis and optimization of SAP SQL |
2. SQL performance analysis with SAP PlanViz |
3. How to improve the performance of your SQL functions |
4. Performance Analysis for SAP Datasphere Transformation Flows |
5. Optimize SAP Datasphere Views: Visual Performance Analysis with PlanViz |
Earlier this year, SAP released a new feature with the Runtime Metrics, which is available in Data Builder under Tools.
This allows you to start the analysis directly during the implementation of the view.
The Execute entry starts the run and displays a summary of the results. In addition, the delta between the runs is displayed. This allows you to immediately see the effects of your changes.
The Generate Explain Plan option works in the same way as the EXPLAIN
command in SQL. Here you can gain insights into the operators and execution engine.
Please note that switching between different engines in the middle of execution has a particularly negative effect on performance. With the Download entry, you can also save the information in the form of a CSV file.
For nested views that in turn use other views, you can use the Impact and Lineage Analysis to perform performance analysis for individual views.
To do this, select the respective view and choose Runtime Metrics in the dialog. Here you can perform the analysis as usual.
Similar to transformation flows, PlanViz files can also be created for views for visual evaluation. To do this, select the Open View Analyzer entry in the Runtime Metrics dialog.
Then select the Generate Plan File for SQL Analyzer entry in the View Analyzer settings and click Start. You will now be redirected to the Data Integration Monitor. Here you can download the PlanViz file (*.plv).
The file can be evaluated in Eclipse using SAP HANA PlanViz. Alternatively, the SQL Analyzer Tool for SAP HANA extension is available in Visual Studio Code.
Open Eclipse and follow the menu path Window → Perspective → Open Perspective → Other.
Then select the SAP HANA PlanViz entry and confirm your selection with Open.
Then open the downloaded file via File → Open File. The overview shows the runtime, the operators, and the number of tables and data records.
In the Executed Plan view, you will find detailed information about the individual execution steps. There you can see the respective duration, the number of data records, and the operations performed. The visual representation makes analysis much easier.
We have already explained these details in detail in our article “Performance Analysis for SAP Datasphere Transformation Flows” in the tabs Timeline, Operator List, Tables Used, and Performance Trace. Take a look!
The new runtime metrics for SAP Datasphere Views greatly simplify performance analysis. Developers receive meaningful key figures directly in Data Builder, enabling them to identify bottlenecks more quickly and remedy them in a targeted manner.
The ability to examine nested views in detail and perform a visual evaluation using PlanViz is particularly helpful. This allows optimization potential to be identified at an early stage, which not only makes the work of developers easier, but also ultimately impresses users with more stable and faster applications.
Do you have questions about SAP Datasphere Views another topic? Just get in touch with us – we look forward to hearing from you!