Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Transactions need to be ACID, but the "Durability" needs to be enforced only at the transaction's end. So physical IO to the disk may be postponed after the apparent SQL statement execution and actually done in the background, while your transaction is processing other statements.</p> <p>As a consequence, issuing SQL statements <em>serially</em> may not be much slower than issuing them <em>concurrently</em>. Consider this scenario:</p> <ul> <li>Execute the SQL statement [A] that writes data. The disk is not actually touched, writes are simply queued for later, so the execution flow returns very quickly to the client (i.e. [A] does not block for long).</li> <li>Execute the SQL statement [B] that writes data. Writes are queued and [B] does not block for long, just as before. The physical I/O of [A] may already be happening in the background at this point.</li> <li>Other processing takes place in the transaction, while DBMS performs the physical I/O to the disk in the background.</li> <li>The transaction is committed. <ul> <li>If queued writes are finished, there is no need to wait.</li> <li>If queued writes are not finished by now, wait until they are. BTW, some databases can relax the "Durability" requirements to avoid this wait, but not MS SQL Server (AFAIK).</li> </ul></li> </ul> <p>Of course there are scenarios where this "auto-parallelism" of DBMS would not work well, for example when there is a <code>WHERE</code> clause that for different statements touches different partitions on different disks - DBMS would love to parallelize these clauses but can't if they are fed to it one-by-one.</p> <p>In any case, don't guess where your performance bottleneck is. Measure it instead!</p> <hr> <p>BTW, MARS will not help you in parallelizing your statements - according to <a href="http://msdn.microsoft.com/en-us/library/ms131686.aspx" rel="nofollow">MSDN</a>: <em>"Note, however, that MARS is defined in terms of interleaving, not in terms of parallel execution."</em></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload