Additional SQL Server features and topics not covered by specific categories
If a query has OPTION(MAXDOP 2), the query will never use more than two cores. There are several reasons why the query still could execute serially:
- The optimizer estimate that serial plan will have lower cost. Parallelism comes with overhead.
- The query cost is below the configuration setting
cost threshold for parallelism. - The query includes operations that blocks parallelism. (In this case, the operation may only block part of the plan from being parallel.)
- Even if the optimizer has a arrived at a parallel plan, SQL Server may make a run-time decision that there is not enough resources for a parallel plan, and still run a serial plan.
- The estimates for how to partition the data between the threads are completely wrong, so all data end up in one thread. This is the worst of them all. The execution is serial, but you still have all the overhead of paralellism.