CDS Views - Performance & Reproducing Issues

You might also like

You are on page 1of 3

CDS Reproducing

Views – Performance
Issues &
CDS Views – Reproducing Issues

CDS Views Might Need ‘SAP_SYSTEM_DATE’

When reproducing issues with CDS views (in the SQL Editor), please set in addition to the CDS_CLIENT also the
SAP_SYSTEM_DATE in the format YYYYMMDD.

For example:

set 'CDS_CLIENT' = '234’;


set 'SAP_SYSTEM_DATE' = '20191028’;
select * from MY_CDS_VIEW where MANDT = '234';

Internal
CDS Views – Performance Recommendations
 Avoid joining non-key fields (…to avoid m:n cardinalities).

 Use associations instead of LEFT OUTER JOIN so that additional joins are only executed when fields
from associations are explicitly requested by path notation.

 Allow join pruning by defining outer joins as LEFT OUTER MANY TO ONE joins and associations with
“TO ONE” cardinality ([n..1]). In this case, if no field is requested from the joined table, the Optimizer can
avoid executing the join at runtime.
This happens when the following conditions are fulfilled:
 Fields coming from the right side of the join are not requested in the field list.
 No filter, ORDER BY or GROUP BY is applied to the right side.
With MANY TO ONE/TO ONE, the optimizer assumes that there is a n:1/1:1 cardinality. Therefore, as the
join does not change the cardinality of the result set, there is no need to execute it if no field is required
from the right side.

 Maintain performance annotations for your CDS views. Follow the recommendations of CDS views with
service quality A, B, or C.

You might also like