title: Why are batch inserts/updates faster? How do batch updates work?
body: <p>Why are batch inserts faster? Is it because the connection and setup overhead for inserting a single row is the same for a set of rows? What other factors make batch inserts faster?</p>
  
  <p>How do batch updates work? Assuming the table has no uniqueness constraints, insert statements don't really have any effect on other insert statements in the batch. However, during batch updates, an update can alter the state of the table and hence can affect the outcome of other update queries in the batch. </p>
  
  <p>I know that batch insert queries have a syntax where you have all the insert values in one big query. How do batch update queries look like? For e.g. if i have single update queries of the form:</p>
  
  <pre><code>update &lt;table&gt; set &lt;column&gt;=&lt;expression&gt; where &lt;condition1&gt;
  update &lt;table&gt; set &lt;column&gt;=&lt;expression&gt; where &lt;condition2&gt;
  update &lt;table&gt; set &lt;column&gt;=&lt;expression&gt; where &lt;condition3&gt;
  update &lt;table&gt; set &lt;column&gt;=&lt;expression&gt; where &lt;condition4&gt;
  </code></pre>
  
  <p>What happens when they are used in a batch. What will the single query look like ? </p>
  
  <p>And are batch inserts &amp; updates part of the SQL standard?</p>