title: Update multiple rows with CASE takes forever
body: <p>I am trying to update multiple rows of a table with the following PHP code. main_key is the primary key and is obviously indexed. I have tried to run the code multiple times and every time I do it just sits there for ages. (I have not been game to leave it running for more than about 10 seconds in case it is trashing the file somehow.)</p>
  
  <p>I want to update lots of rows but am just testing with a couple of lines first. </p>
  
  <p>The table has around 1.5M records. </p>
  
  <pre><code>$query = "UPDATE myfile SET service_no = 
  (CASE main_key
       WHEN 72016 THEN 484
       WHEN 985643 THEN 1874
  END)";
  mysql_query($query) or die(mysql_error());
  </code></pre>
  
  <p>When I change the code to a normal single-record update like this it runs instantly:</p>
  
  <pre><code>$query = "UPDATE myfile SET service_no = 484
            WHERE main_key = 72016";
  mysql_query($query) or die(mysql_error());
  </code></pre>