Replace LEFT JOIN with INNER JOIN whenever it's possible