09-19-2013 2:14 PM
In ABAP programming it is cost-efficient to do one SELECT to retreive the data set you want to work with and load this into an internal table. Then the rest of the operations is done on the internal table, which was (before the DB became HANA) and still is in memory. But does this advantage still hold true when you run SAP or in my case SAP BW 7.3 on HANA? Because all data is in-memory is it still advantageous to use one SELECT to load your dataset into an internal table? Why is this the case?
09-23-2013 5:15 PM
Hi Andre,
There is one basic difference. The internal table is "in-memory" of the ABAP application server, where as the table data is "in-memory" of the HANA database server. The ABAP application server is not installed on the same HANA server hence these are two different "memory" locations.
It is advisable to push the logic to the HANA memory and avoid fetching the data from HANA database to ABAP application server for processing (like getting them in the internal table).
Hope this clarifies.
Regards,
Ravi
09-23-2013 5:09 PM
Hi André,
hm i don't get the question.... no matter on which DB you are runnig... you should:
select only those rows and columns that you actually need in one go in an internal table and work with that...
or the other way round:
don't select data you don't need
don't select row by row (use arrays)
Kind regards,
Hermann
09-23-2013 5:15 PM
Hi Andre,
There is one basic difference. The internal table is "in-memory" of the ABAP application server, where as the table data is "in-memory" of the HANA database server. The ABAP application server is not installed on the same HANA server hence these are two different "memory" locations.
It is advisable to push the logic to the HANA memory and avoid fetching the data from HANA database to ABAP application server for processing (like getting them in the internal table).
Hope this clarifies.
Regards,
Ravi
09-23-2013 5:29 PM
Hi,
oh for sure, push down all calculations and let the DB do it.
Then the final result get with one select into an internal table.
Don't select data and calculate in ABAP.... select only the
final result set that is needed....
Kind regards,
Hermann
09-24-2013 2:20 PM
Hi Hermann,
Short question would be (assuming equal table size) is it faster to:
- READ Interal Table WITH KEY (loading entire table to application server into an Internal Table, and then perform a Read Table)
- SELECT SINGLE Column FROM Database Table (for each single search do a seperate select on the HANA database)
An expanded example situation to clarify my question:
- You want to read an InfoObject into a DSO from antoher DSO
- The result is further modified before it is inserted in the DSO
- We perform this in the End Routine
Assuming that:
* DSO Size is < Data Package Size
With HANA as the database would we prefer to:
A.
- Read the desired columns from the source DSO in an internal table.
- LOOP AT RESULT_PACKAGE ASSIGNING <Result_Fields> - READ Internal Table with Key and perform operation - ENDLOOP (with hashed internal table for performance)
B.
- LOOP AT RESULT_PACKAGE ASSIGNING <Result_Fields>- SELECT SINGLE Column FROM DSO or maybe performe operation directly in select - ENDLOOP
09-24-2013 2:46 PM
Hi,
the read is faster than the select single. Variant A is advicable.
Don't use select in loops.
and for the selects that fill the itab buffers do only one select that gets only the necessary data (no data that is not required and no aggregation in the abap prorgam).
Kind regards,
Hermann