Select optimization

It's targeted 3.3 only, as 3.4 has recent fix, which solves the problem.