Search code examples
abaphanaopensqlamdp

Performance of AMDP vs HANA DB procedure?


As far as I know there is very little difference between the two except syntax. You have to use:

CALL METHOD for AMDP
CALL DATABASE PROCEDURE for HANA Procedure

Is the AMDP performance affected by the fact it is run at ABAP Application Server?

Can this architectural downside be overcome by the SQL optimizations when comparing to HANA proc? What is the best entity to use (AMDP or HANA proc) when dealing with complex queries with multiple WITH and JOIN?


Solution

  • AMDP is the abbreviation of ABAP Managed Database Procedure

    As the name implies, these are still database procedures, but more easy to create, maintain and transport, as they are stored in the Dictionary.

    If you look into the definition of one, you will immediately see that the body is written in sqlscript1, the language that SAP uses for HANA DB procedures. It will run on the database.

    There is no performance difference. If you can write efficient DB procedures, you can write efficient AMDP.

    How to make them faster

    Create a PlanViz file, check where the time is spent. Most often the JOIN conditions can be improved, sometimes a field is missing, or it is performed on calculated fields.


    1. or L, or R, but never in ABAP