Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parallelism in SQL Server Execution Plan

I was trying to optimize my query and I've come across a Parallelism show plan operator, which I have not yet encountered before.

Was wondering, what is this for, and what does it indicate if it is included in an execution plan?

Thanks!

like image 226
mallows98 Avatar asked Jul 18 '11 04:07

mallows98


People also ask

What is parallel plan execution in SQL Server?

Max Degree of Parallelism, also known as MAXDOP, is a server, database, or query level option that determines the maximum number of logical processors that can be used when a query is executed. By default, this option is set to 0, and it means that the query engine can use all available processors.

What is the max degree of parallelism?

The maximum degree of parallelism (MAXDOP) is a server configuration option for running SQL Server on multiple CPUs. It controls the number of processors used to run a single statement in parallel plan execution. The default value is 0, which enables SQL Server to use all available processors.

What is parallel query execution?

Parallel query is a method used to increase the execution speed of SQL queries by creating multiple query processes that divide the workload of a SQL statement and executing it in parallel or at the same time.


1 Answers

A Parallelism operator in a SQL Server execution plan shows that multiple threads will perform the work. For example, if the optimiser calculates that an operation would benefit from and can be split into multiple streams, it distributes into multiple streams of execution, performs the task in separate streams and then gathers the multiple streams back into a result set.

The Parallelism operator performs the distribute streams, gather streams, and repartition streams logical operations.

If you haven't seen it already: Execution Plan Basics

Distribute streams execution plan icon Distribute streams execution plan icon

Gather streams execution plan icon Gather streams execution plan icon

Repartition streams execution plan icon Repartition streams execution plan icon

like image 102
Mitch Wheat Avatar answered Oct 03 '22 18:10

Mitch Wheat