title: SQL query alternative/optimization for LEFT OUTER JOIN
body: <p>I have the following query:</p>
  
  <pre><code>SELECT
      `pokemon_moves`.`pokemon_move_method_id`,
      `pokemon_moves`.`level`,
      `move`.`id`,
      `move`.`name`
  FROM
      `pokemon_moves`
  LEFT OUTER JOIN
      `moves` `move` ON
          `move`.`id` = `pokemon_moves`.`move_id`
  WHERE
      `pokemon_moves`.`pokemon_move_method_id` &lt; '4' AND
      `pokemon_moves`.`pokemon_id` = '2' AND
      `pokemon_moves`.`version_group_id` = '6'
  ORDER BY
      CAST(`pokemon_moves`.`level` as INTEGER) ASC,
      `move`.`name` ASC
  </code></pre>
  
  <p>It is kinda slow and I think that's because the <code>moves</code> table is queried for every row in the pokemon_moves table instead of only the ones that comply to the WHERE clause. What would be a better option to write this query?</p>
  
  <p><em>Please note that the integers in this (external) table are stored as text</em></p>