Turn relation queries into left joins which are faster