Remove n+1 lookup values on stock item exist SQL call

fixes #5774