Rule Definition
The ORDER BY clause is executed on the database server while the ABAP SORT statement is executed on the application server. The database server will usually be the bottleneck so, for performance reason, it is often better to move the sort from the database server to the application server.
Remediation
If you are not sorting by the primary key ( E.g. using the ORDER BY PRIMARY key statement) but are sorting by another key, it could be better to use the ABAP SORT statement to sort the data in an internal table. Note however that for very large result sets it might not be a feasible solution and you would want to let the database server sort it.
Violation Code Sample
SELECT * FROM sflight
ORDER BY currency price.
Fixed Code Sample
DATA flights TYPE TABLE OF sflight.
SELECT * FROM sflight INTO TABLE flights.
SORT flights BY currency price.
Reference
http://erpgenie.com
ABAP Syntax performance tuning
Related Technologies
Technical Criterion
Efficiency - SQL and Data Handling Performance
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.