title: Redshift UPDATE prohibitively slow
body: <p>I have a table in a Redshift cluster with ~1 billion rows. I have a job that tries to update some column values based on some filter. Updating anything at all in this table is incredibly slow. Here's an example:</p>
  
  <pre><code>SELECT col1, col2, col3
  FROM SOMETABLE
  WHERE col1 = 'a value of col1'
    AND col2 = 12;
  </code></pre>
  
  <p>The above query returns in less than a second, because I have sortkeys on <code>col1</code> and <code>col2</code>. There is only one row that meets this criteria, so the result set is just one row. However, if I run:</p>
  
  <pre><code>UPDATE SOMETABLE
  SET col3 = 20
  WHERE col1 = 'a value of col1'
    AND col2 = 12;
  </code></pre>
  
  <p>This query takes an unknown amount of time (I stopped it after 20 minutes). Again, it should be updating one column value of one row.</p>
  
  <p>I have also tried to follow the documentation here: <a href="http://docs.aws.amazon.com/redshift/latest/dg/merge-specify-a-column-list.html" rel="noreferrer">http://docs.aws.amazon.com/redshift/latest/dg/merge-specify-a-column-list.html</a>, which talks about creating a temporary staging table to update the main table, but got the same results.</p>
  
  <p>Any idea what is going on here?</p>