Hello,
if possible, try to integrate the selection of mara into your join, therefore all selections runs on the database.
Use ORDER BY at the select of afko, so the database sort your resultset.
Another point: The table mara should be very huge. If possible, try to select a subset.
Kind regards,
Hendrik