Skip to Content
1

ABAP Development : SAP HANA ORDER BY or SORT internal table

Mar 01, 2017 at 08:17 AM

344

avatar image
Former Member

With a database on SAP HANA is the old performance rule still true that you should only use ORDER BY if the database is accessed by the same index for sorting as for reading; otherwise it is more efficient to import into internal table and then sort within the program ? (I am referring to a "rule" from the SAP ABAP Objects book by Keller and Kruger - page 734).

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Horst Keller
Mar 01, 2017 at 10:47 AM
2

The recent performance hints are much shorter and don't say that you shouldn't sort at DB level. In the age of code push down that would be counter intuitive.

https://help.sap.com/http.svc/rc/abapdocu_751_index_htm/7.51/en-US/index.htm?file=abenopen_sql_perfo.htm

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thanks Mr Keller !. Great to get an answer from the Author of the book.

...had to look this up > to quote "

Code pushdown means delegating data intense calculations to the database layer. It does not mean push ALL calculations to the database, but only those that make sense."

So I assume then it makes sense to let the database perform the ordering.

1
Former Member

Hi Jonny,

Quite right !! I entered ABAP domain lending a book from the library - 'ABAP Objects' by Horst Keller and Sascha Kruger and this has been a privilege to have one question answered by the writer. Thanks SAP for this community !

However, as you termed ORDER BY, please have a look at this below link if you haven't :

https://blogs.sap.com/2014/10/02/abap-news-for-740-sp08-grouping-internal-tables/

0