Hi All,
SAP CDS HINTS
Hints can be used to influence preparation, optimization, and execution of SQL statements. Hint can be modeled on view level using annotations, While working with CDS hints we learned few things. |
Following blog Optimize CDS views using dbHints annotation | SAP Blogs we ran into a scenario as below:
CDS Hint annotation:
@AbapCatalog.dbHints: [{dbSystem: #HDB, hint: ‘<hint_name>’}] .“→ which is now deprecated annotation
SELECT *
FROM Z<CDS View>
WITH HINT ( USE_ESX_PLAN )
We faced below error by after calling the CDS in abap statement:
SAP CDS HINTS GRAMMAR ERROR
Hence we have to use the up-to-date annotation as below:
@Consumption.dbHints: ['HINT1', 'HINT2'] ."→ up-to-date annotation
Example as shown below:
CDS hints annotation (old and new)
Further calling the above sample CDS into ABAP code as below for successful usage, and found significant performance increase in testing environment.
SELECT * FROM zckub %_HINTS HDB 'USE_OLAP_PLAN' INTO TABLE @DATA(lt_tab).
This is example on how to use and apply CDS dbHints into existing SAP ABAP program.
Useful? like and share on social media.
Connect with me on:
Thank you,
Pavan Golesar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
3 | |
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 |