I have a big linq to sql query which runs in parallel mode.
It is returning results in 8 seconds and it is pretty good.
I noticed in the execution plan that the extreme right part(from where execution plan is read) of the execution plan has a serial portion.
I checked the execution plan and i see that the serial part is calculating some expressions such as the where conditions
Start Date and
End date is applied and calculated.
But i don't understand why it is being in serial mode.
AS per the screenshot,it says
Scalar Operators[Expr1169] and
As you can see in the next screenshot, after the expressions are calculated and after from
Nested Loops ,the execution goes into Parallel mode.
I am trying to understand the serial part of the query ,because i have optimized the query few times to strictly run in parallel mode.
I have removed some scalar functions earlier and other db objects which can cause serial execution.
Screenshot 2 Please find the anonymized execution plan. Execution PLan
- Statistics are updated
- Index Fragmentation is taken care off
- 96 GB out of 128GB is used by SQL Server.
- SQL Server 2016
Statistics are updated.