I do a query to fetch all restaurants in my mysql db. After that, I sort these on distance to the user with the PHP usort function, based on their lat/lng coordinates.
What's the most efficient way to paginate the usorted array, without needing to do a query and usort on all items each new paginated page?