optimize IN and NOT IN with one or no members