Skip to Content

ABAP Development : SAP HANA ORDER BY or SORT internal table

Mar 01, 2017 at 08:17 AM


avatar image

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

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.

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

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.

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 :