[FIX #7609] Fetch and cache data for sorting column in one query