CDS – 23: Fundamentals of CDS Performance Analysis – 1

With CDS Views, speed is improved since data-intensive computations and aggregations are performed at the database layer (rather than the usual application layer) using the code pushdown architecture.

Everyone expects the magic to happen every time with the code pushdown. If not optimized, performance ought to be higher at all times. However, in actual project circumstances, nothing goes as planned. There have been cases where the query fails to deliver the anticipated improvement in performance. In this series of several parts, we will first examine how well the underlying query is doing and then discuss several tuning strategies.

Although there are a ton of Core Data Services available online, it is rare to find quality courses or series on ABAP Core Data Services optimization and performance tuning. This series should benefit our SAP Fraternity, perhaps. 🙂

First, the basics.

ADT is used in the development of ABAP CDS views, which are then executed in the database.
Because of the underlying annotations that affect performance, Analytical Query CDS operate differently from Consumption View CDS (We will address this in Part 2).
Analytical Query CDS can be troubleshooted via transaction RSRT in order to find authorization or Fiori related problems. One of the first things that should be done to isolate and determine whether the problem is performance-related is this.

As an illustration, the SQL statement that results from the Trial Balance CDS (IFIGLBALCUBE/I_GLACCTBALANCECUBE) execution in 1709 is as follows.

Fear not—we’ll learn how to get this SQL statement in the posts that follow.

SELECT /* CDS access control applied */ "COMPANYCODE" "K____360" , 
"CHARTOFACCOUNTS" "K____359" , 
"GLACCOUNT" "K____366" , 
"FISCALPERIODDATE" "K____443" , 
"COMPANYCODECURRENCY" "K____479" , 
COUNT(*) "Z____110_SUM" , SUM( "DEBITAMOUNTINCOCODECRCY" ) 
"Z____3159_SUM" , SUM( "ENDINGBALANCEAMTINCOCODECRCY" ) 
"Z____3163_SUM" , SUM( "CREDITAMOUNTINCOCODECRCY" ) 
"Z____3187_SUM" 
FROM /* Entity name: I_GLACCTBALANCECUBE CDS access controlled */ 
"IFIGLBALCUBE" ( "P_FROMPOSTINGDATE" => ? , "P_TOPOSTINGDATE" => ? ) 
"A1" WHERE "MANDT" = ? AND "COMPANYCODE" = ? AND 
"LEDGER" = ? GROUP BY "COMPANYCODE" , "CHARTOFACCOUNTS" , 
"GLACCOUNT" , "FISCALPERIODDATE" , 
"COMPANYCODECURRENCY" ORDER BY "A1" . "COMPANYCODE" , "A1" . 
"GLACCOUNT"  WITH HINT
(DOUBLE_PREAGGR_BEFORE_JOIN,USE_OLAP_PLAN,RESULT_LAG ('hana_long')) 
WITH RANGE_RESTRICTION('CURRENT')
  • In the formation of the SQL statement, it will be important to know whether the CDS view has authorization limitations via DCL (Data Control Language). The term “CDS access control” in the preceding sentence denotes the application of permission limitations during execution and the existence of a matching DCL.
  • If the annotations for the CDS query contain database hints (the previous example contains HINT(DOUBLE_PREAGGR_BEFORE_JOIN,USE_OLAP_PLAN,RESULT_LAG (‘hana_long’))), this will also affect the CDS’s execution plan, which creates the SQL statement.
  • CDS views use a stacking approach of operation. (To increase scalability and resilience, views are stacked and reused). There will be a performance hit if the stacking is not ideal.

How is the stacking model to be understood?

After the relevant CDS view opens in ADT, right-click and select

Select Dependency Analyzer to Open With.

  • This will display the SQL Dependency Tree, which illustrates the top-down process of selection.

Keep a close eye on the tabs located at the bottom of the screen.

The SQL Dependency Graph aids in your understanding of the database choice by providing a visual depiction of the Tree. (To improve efficiency, this is a useful tool to utilize to eliminate any unnecessary branches from the SQL query).

Complexity Metrics provide a clear picture of how many database tables the CDS view uses. (Note that this list only includes design-time associations, joins, unions, aggregations, etc.; runtime associations are not included.)

This provides a fundamental understanding of how CDS view functions internally and highlights the key factors that influence performance..

This is merely the very beginning. To have a deeper understanding of CDS Performance Tuning, we will go further. Please continue to watch.


you may be interested in this blog here:-

Benefits of Using Salesforce Nonprofit Cloud for Event Planing

ABAP for SAP HANA. ALV Report On SAP HANA – Opportunities And Challenges

  • Related Posts

    Handle the Handle Classes correctly

    Let’s delve into the Handle the Handle Classes correctly. Gone are the days where we had the freedom to have import boundaries as tables, designs or single fields. SAP has…

    Steps to add custom Tab in standard MIRO item screen using BADI MRM_ITEM_CUSTFIELDS

    Steps to add custom Tab in standard MIRO item screen using BADI MRM_ITEM_CUSTFIELDS can be utilized to upgrade the standard MIRO detail screen and add the new custom Tab and…

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    You Missed

    Handle the Handle Classes correctly

    • By Varad
    • March 30, 2025
    • 13 views
    Handle the Handle Classes correctly

    Steps to add custom Tab in standard MIRO item screen using BADI MRM_ITEM_CUSTFIELDS

    • By Varad
    • March 29, 2025
    • 23 views
    Steps to add custom Tab in standard MIRO item screen using BADI MRM_ITEM_CUSTFIELDS

    Add custom fields in standard MIRO header screen through BADI_FDCB_SUBBAS01

    • By Varad
    • March 28, 2025
    • 28 views
    Add custom fields in standard MIRO header screen through BADI_FDCB_SUBBAS01

    Steps to stop debugger at ELM BADI CRM_MKTLIST_BADI from Web UI Screen

    • By Varad
    • March 27, 2025
    • 38 views
    Steps to stop debugger at ELM BADI CRM_MKTLIST_BADI from Web UI Screen

    Steps to stop debugger at ELM BADI CRM_MKTLIST_BADI from Web UI Screen

    • By Varad
    • March 26, 2025
    • 34 views
    Steps to stop debugger at ELM BADI CRM_MKTLIST_BADI from Web UI Screen

    How to find BAdIs ?

    • By Varad
    • March 25, 2025
    • 42 views
    How to find BAdIs ?