ALTER INDEX [PK_Order_Line_Inventory] 
ON [OrderManager_C].[Order_Line_Inventory] REBUILD 

This was satisfied by 3 threads within SPID 58. However, arguing over the same data page, one of the threads became the DEADLOCK victim. Process IDs are different, as are the Execution Context IDs and the Txn properties. There are actually two DEADLOCKs for this same command, one for the 3 threads, the 2nd for the surviving 2 that then became one.

The SQL 2017 Guidelines for Online Index Operations has this paragraph, "Although not common, the online index operation can cause a deadlock when it interacts with database updates because of user or application activities. In these rare cases, the SQL Server Database Engine will select the user or application activity as a deadlock victim.", but as the deadlock involved "itself", my root cause wasn't found.

The table has just a single-column, bigint, Clustered PK, and contains 2.7M rows in 520MB; one FK to its parent in a 1::0/1 relationship.

Questions arise:

  1. Is this a bug? I've not seen this behavior in over a decade with SQL Server.
  2. Did any of the REBUILD survive?
  3. Is this likely to recur?
  4. I guess I could enhance our Defrag Tool to allow an option to override MAXDOP=4 to =1 for specific tables, but is that really necessary?

I've hunted for similar occurrences but what looked a promising link from SQLCoffee to MS KB978250 met a 404 error and no hits at all from searching MS (Original thread). That KB spoke of a fix to SQL2008 - if relevant, one would assume it should still be a fix in the 2016 bits...

Can anyone shed any light on this, please?

Graph: On OneDrive


1 Answer 1


Sounds like an intra-query parallelism deadlock.

They're generally considered bugs because there's not much you can do about it, other than to rerun the query or drop the maxdop of the statement down (if its happening often for the same query).

Here is some information to help troubleshoot them, hope this helps.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.