title: Optimizing sybase SQL Query
body: <p>Is there a way to optimize the following query:</p>
  
  <pre><code>UPDATE myTable
  SET Calculation =
    (SELECT MAX(Calculation)
     FROM myTable T
     WHERE T.Id = myTable.Id
       AND T.Flag='N')
  WHERE Calculation='NA'
    AND Flag='Y'
  </code></pre>
  
  <p>where myTable has approx. 4 million rows? Actually the first not NULL will do the job (SYBASE ASE 15.0.2).</p>