optimized load order query