Fixed major Select N+1 performance issue