Optimized random effects sampling