Beruflich Dokumente
Kultur Dokumente
Benjamin Nevarez
Blog: benjaminnevarez.com
Twitter: @BenjaminNevarez
About the Speaker
Benjamin Nevarez
Author of “Inside the SQL
Server Query Optimizer” and
“SQL Server 2014 Query Tuning
& Optimization”
Parsing first makes sure that the T-SQL query has a valid syntax
Binding is mostly concerned with name resolution
Uses the query information to build a tree of relational operators
Demo
Logical Trees
Simplification
Reduces the query tree into a simpler form in order to make the
optimization process easier
Some of the simplifications include:
• Filters in WHERE clauses are pushed down in the query tree in order
to enable early data filtering (predicate pushdown)
Simplification
Transformation Rules
Transformation Rules
The Memo
Search data structure that is used to store the alternatives which are
generated and analyzed by the Query Optimizer
A new memo structure is created for each optimization
The Query Optimizer copies the original query tree's logical expressions
into the memo structure
The Memo
After Optimization
Demo
The Memo
Optimization Phases – Full Optimization
Thank You!