move key WQL restrictions from WHERE/IN to JOIN