Join optimization [ci skip]