title: How does SQL Server calculate the Cost Threshold for Parallelism
body: <p>Thank you in advance.   </p>
  
  <p>We have a SQL Server 2008 R2 database server serving web content.  The server has 2 dual core CPUs.  MDOP is set to 2, and the Cost Threshold is set to 5 (default).</p>
  
  <p>We have a few queries that seem to peg our CPU when put under load.  We are seeing high values for CXPACKETS and SOS_Scheduler_Yield wait types.</p>
  
  <p>How does SQL Server Calculate the expense of the query?  I would like to make sure we set the correct value for the Cost Threshold value.</p>
  
  <p>Thanks,
  Pete</p>