subquery elimination