Mentor SAP

The classic performance guidelines for using Open SQL and for ABAP Programming essentially remains valid.

 

These guidelines can be called the five golden rules which are as follows:

  1. Keep the result set small
  2. This reduces both the amount of memory used in the database system and the network load when transferring data to the application server. To reduce the size of your result sets, use the WHERE and HAVING clause.

     

  3. Minimize the amount of data transferred
  4. To only transfer the columns you really need, use SELECT with a field list, instead of SELECT *.

     

  5. Minimize the number of database accesses
  6. On all database systems, there is a small performance overhead associated with every request for connection handling, SQL parsing, execution plan determination, and so on. Use JOINs and/or sub-queries instead of nested SELECT loops.

     

    Do not retrieve unnecessary data from the database by selecting any of the following:

    • Minimal number of rows
    • Minimal number of columns
    • Minimal number of database interactions

     

  7. Minimize the search overhead
  8. Minimize the size of the result set by using WHERE and HAVING clauses. To increase the efficiency of these clauses, formulate them to fit with the database table indexes.

     

  9. Reduce the database load
  10. Unlike application servers and presentation servers, there is only one database server in your system. Use the following methods: avoid reading data redundantly, use table buffering(if applicable) and do not bypass it, and sort data in your ABAP programs.

Some guidelines become even more important with SAP HANA.

  1. Do not retrieve rows and discard them later using CHECK or EXIT statements, for example in loops.
  2. The more fields you use in the field list, the more columns have to be unpacked.
  3. Use mass processing wherever possible
  4. All rows and columns that are needed should be selected in one SQL statement.
  5. Calculation and aggregation in the database are efficient.