title: Is bulk update faster than single update in db2?
body: <p>I have a Table with 10 columns and in that table I have thousands/millions of rows.
  In some scenario, I want to update more than 10K records at a time. currently my scenario code works sequentially like,</p>
  
  <pre><code>for i in (primary key ids for all records to be updated)
       executeupdate(i)
  </code></pre>
  
  <p>what I thought is instead of running same query 10K times, I will add all ids in a string and run a single update query like,</p>
  
  <pre><code>executeupdate(all ids) 
  </code></pre>
  
  <p>actual DB queries can be like this,</p>
  
  <p>suppose I have primary key ids like, </p>
  
  <pre><code>10001,10002,10003,10004,10005
  </code></pre>
  
  <p>so in first case My queries will be like </p>
  
  <pre><code>update tab1 set status="xyz" where Id="10001"
  update tab1 set status="xyz" where Id="10002"
  update tab1 set status="xyz" where Id="10003"
  update tab1 set status="xyz" where Id="10004"
  update tab1 set status="xyz" where Id="10005"
  </code></pre>
  
  <p>and My bulk update query will be like,</p>
  
  <pre><code>update tab1 set status="xyz" where id in ("10001","10002","10003","10004","10005")
  </code></pre>
  
  <p>so My question is, will I get any Performance improvement (executime time) by doing bulk update
  or total query execution time will be same as for each record index scan will happen and update will take place?</p>
  
  <p><strong>Note : I am using DB2 9.5 as database</strong></p>
  
  <p>Thanks. </p>