Please enable JavaScript.
Coggle requires JavaScript to display documents.
Query optimization (Simplification (Trivial search (Statistics update…
Query optimization
Simplification
Trivial search
Statistics update
Cost-based optimization
-
-
-
-
Optimization can be completed at any stage, as soon as a “good enough” plan is found
-
-
-
if there is a trivial plan available for the
query. This happens when a query has either only one plan available to execute, or when the choice of plan is obvious.
-
-
-
Operators
Physical
Joins
Merge
works with two sorted inputs. It compares two rows, one at time, and returns their join to the client if they are equal. Otherwise, it discards the lesser value and moves on to the next row in the input. Contrary to nested loop joins, a merge join requires at least one equality predicate on the join keys.
Hash join
-
The first phase (build) - scans one of inputs, calculates the hash values of the join key, and
places it into the hash table
The second phase (probe) - it scans the second input, and checks, or probes, if the
hash value of the join key from second input exists in the hash table
-
Aggregations
Stream - performs the aggregation based on sorted input, for example, when data is sorted on a column,
which is specified in a group by clause.
-
-
-
-
The documented data management view sys.dm_exec_query_optimizer_info, allows you to retrieve Query
Optimizer related statistics.