Enterprise Resource Planning Blogs by Members
Gain new perspectives and knowledge about enterprise resource planning in blog posts from community members. Share your own comments and ERP insights today!
cancel
Showing results for 
Search instead for 
Did you mean: 
abhimanyu_sharma
Contributor
Just want to share few interesting points on the CDS view performance Annotation for CDS view performance. SAP has released some guidelines to improve the performance of CDS views.

The best way to learn these guidelines is to learn from standard CDS views and apply in our custom views.

 

In most of the standard CDS views, we have seen below 3 annotations being used by SAP in order to improve performance. But I have seen we are not using it in our custom views which might impact performance while fetching data. Hence it would be good practice to use these annotations properly and benefit with performance.

 

  1. @ObjectModel.usageType.serviceQuality

  2. @ObjectModel.usageType.sizeCategory

  3. @ObjectModel.usageType.dataClass


 

( Note : In case where we want to see list of CDS view doesn’t have these annotations,  SAP has provided a standard table : DDHEADANNO. This table will have information of all the annotations being used in CDS views present in the system. So you can create a report program on this table where we can find out CDS views which doesn’t have above annotations with %usagetype% keyword. )

 

Valid values for serviceQuality: #A, #B, #C, #D, #X, #P

 

Valid values for sizeCategory: #S, #M, #L, #XL, #XXL

 

Valid values for dataClass: #TRANSACTIONAL, #MASTER, #ORGANIZATIONAL, #CUSTOMIZING, #META, #MIXED

 

Now will see below charts where we will see in what cases we should use these annotations :  



 



 



 

 

Combination of Characteristics to be used for annotations in CDS views



 

Test Results :

 



 

Conclusion :

 

  1. Keep CDS views simple (in particular service-Quality A and B = #BASIC views)

  2. Amount of data persisted in S4 CDS views should not exceed 20% of the overall data volume of  the system.

  3. In transactional processing, only use simple CDS views accessed via CDS key

  4. Expose only required fields –define associations to reach additional fields when requested

11 Comments

Excellent article, keep up the good work!!

abprad
Active Participant
Excellent blog , helped me understand the concepts of these 3 .
former_member389532
Discoverer
No doubts that these annotations are useful also during custom development. They are meant to describe some characteristics of the CDS view with respect to their performance behavior in CDS queries. However, they should not have any impact on CDS query performance, because annotations are not even "known" by HANA. In your example you have probably observed another effect unrelated to these annotations. Would be great if you can share some more details of your example to figure out the root cause of the observed performance differences.
yadhu
Explorer
0 Kudos
Hello Heiko Gerwens, Great point regarding the annotations. Is there any other documentation for the real value on these "Performance related annotations" other than for user information/readability/governance of CDS Objects ?
former_member389532
Discoverer
0 Kudos
Those Annotations are e.g., used in ATC checks to insure that CDS views are only used in appropriate contexts
udita10
Explorer
0 Kudos
Hi abhimanyu.sharma ,

 

If in a  CDS I added an annotation that you have specified above, I observed an increased and better performance. But when I removed the annotation and ran the performance trace again, then the trace still shows improved performance.

Any idea why it could be happening ?

Thanks & Regards,

Udita Saklani
AndreasRiehl
Advisor
Advisor
0 Kudos
Hi Udita,

As Heiko stated above (December 2020), setting the annotations @ObjectModel.usageType.dataClass, -serviceQuality or -sizeCategory has no impact on the actual performance at all. The performance improvements you observed when setting them are related to other reasons. This also explains why removing them had no negative impact on the performance.

Best Regards,
Andreas
udita10
Explorer
0 Kudos

Thanksandreas.riehl,

For the response.
But my question still remains valid,
How did the performance increase drastically after I added the annotations( I mean what could be the other reasons like you just stated)?

 

Thanks ,

Udita Saklani

AndreasRiehl
Advisor
Advisor
0 Kudos
Hi udita10,

I am not a performance expert, but the improvement is almost certainly not related to the annotations you set but a different effect. Which one is really hard to say without knowing the view and the way you tested the performance. Maybe just the data volume that had to be processed changed or the system had more free resources when you tested? Did you do repeated tests?

Best Regards,
Andreas
AndreaUS
Product and Topic Expert
Product and Topic Expert
The ABAP Keyword Documentation describes these annotations under https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abencds_view_entity_a....

It says among others: "With the above subannotations of ObjectModel it can be documented for a view for which kind of application it is intended and which kind of data are to expected. This information is especially important in regards of performance that can be expected by the consumer of the view."

 
0 Kudos
Hi,

Maybe the records were buffered?

Best Regards,

Balaji
Labels in this area