Question: Does Parallel Threads Process Equal Rows?
Answer: No. (Well usually no). I received the same question during the Comprehensive Database Performance Health Check. Here is the simple proof running the following query:
SELECT [SalesOrderID] ,[SalesOrderDetailID] ,[CarrierTrackingNumber] ,[OrderQty] ,[ProductID] ,[SpecialOfferID] ,[UnitPrice] ,[UnitPriceDiscount] ,[LineTotal] ,[rowguid] ,[ModifiedDate] FROM [AdventureWorks2014].[Sales].[SalesOrderDetail] ORDER BY [UnitPriceDiscount]
When you run the above query, make sure you enable the actual execution plan (CTRL+M), it will give following execution plan. The execution plan will open a property bar on the right side.
You can see that there is a Clustered Index Scan operator. Click on the operator and right-click over it and select Properties. Over here expand the row Actual Number of Rows. Under this tab, there are multiple rows marked with Thread 0, Thread 1, Thread 2 and so on. On the right side of the Threads, you can see the rows on the side which are not equal at all.
Many think that when the operators which can go parallel divides the total number of rows in the equal number of the rows, which is not correct as we have seen in this example.
I hope this answer Does Parallel Threads Process Equal Rows question. Let me know if you already knew this information or is it new information for you as well.
Reference:Â Pinal Dave (https://blog.sqlauthority.com)
1 Comment. Leave new
No, It doesn’t.