30.06.2013 Views

SQL Server Execution Plans - Red Gate Software

SQL Server Execution Plans - Red Gate Software

SQL Server Execution Plans - Red Gate Software

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 2: Graphical <strong>Execution</strong> <strong>Plans</strong> for Basic Queries<br />

1. Select (Result) 9. Sort 17. Spool<br />

2. Clustered Index Scan 10. Key Lookup 18. Eager Spool<br />

3. NonClustered Index Scan 11. Compute Scalar 19. Stream Aggregate<br />

4. Clustered Index Seek 12. Constant Scan 20. Distribute Streams<br />

5. NonClustered Index Seek 13. Table Scan 21. Repartition Streams<br />

6. Hash Match 14. RID Lookup 22. Gather Streams<br />

7. Nested Loops 15. Filter 23. Bitmap<br />

8. Merge Join 16. Lazy Spool 24. Split<br />

Most operators behave in one of two ways, non-blocking or blocking. A non-blocking<br />

operator creates output data at the same time as it receives the input. A blocking operator<br />

has to get all the data prior to producing its output. A blocking operator might contribute<br />

to concurrency problems, hurting performance.<br />

An example of a non-blocking operator would be the Merge Join, which produces data<br />

even as it is fed the data. We know this because the data in a Merge Join must be ordered<br />

for it to work properly, so it can produce its output as the input comes in.<br />

An example of a blocking operator would be the Hash Match join. It has to gather all the<br />

data prior to performing its join operations and producing output. There are variations<br />

on some operators that may behave in other ways, but these are internals known only to<br />

Microsoft.<br />

Again, the key to understanding execution plans is to start to learn how to understand<br />

what the operators do and how this affects your query.<br />

64

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!