title: CASE vs Multiple UPDATE queries for large data sets - Performance
body: <p>For performance what option would be better for large data sets that are to be updated?</p>
  
  <p>Using a CASE statement or Individual update queries?</p>
  
  <p>CASE Example:</p>
  
  <pre><code>UPDATE tbl_name SET field_name = 
  CASE
      WHEN condition_1 THEN 'Blah'
      WHEN condition_2 THEN 'Foo'
      WHEN condition_x THEN 123
      ELSE 'bar'
  END AS value
  </code></pre>
  
  <p>Individual Query Example:</p>
  
  <pre><code>UPDATE tbl_name SET field_name = 'Blah' WHERE field_name = condition_1
  UPDATE tbl_name SET field_name = 'Foo' WHERE field_name = condition_2
  UPDATE tbl_name SET field_name = 123 WHERE field_name = condition_x
  UPDATE tbl_name SET field_name = 'bar' WHERE field_name = condition_y
  </code></pre>
  
  <p>NOTE: About 300,000 records are going to be updated and the CASE statement would have about 10,000 WHEN conditions. If using the individual queries it's about 10,000 as well</p>