Hash Match Showplan Operator
The Hash Match operator builds a hash table by computing a hash value for each row from its build input. A HASH:() predicate with a list of columns used to create a hash value appears in the Argument column. Then, for each probe row (as applicable), it computes a hash value (using the same hash function) and looks in the hash table for matches. If a residual predicate is present (identified by RESIDUAL:() in the Argument column), that predicate must also be satisfied for rows to be considered a match. Behavior depends on the logical operation being performed:
For any joins, use the first (top) input to build the hash table and the second (bottom) input to probe the hash table. Output matches (or nonmatches) as dictated by the join type. If multiple joins use the same join column, these operations are grouped into a hash team.
For the distinct or aggregate operators, use the input to build the hash table (removing duplicates and computing any aggregate expressions). When the hash table is built, scan the table and output all entries.
For the union operator, use the first input to build the hash table (removing duplicates). Use the second input (which must have no duplicates) to probe the hash table, returning all rows that have no matches, then scan the hash table and return all entries.
Hash Match is a physical operator.
Graphical execution plan icon
TasksHow to: Display an Actual Execution Plan
ReferenceHash Match Team Showplan Operator
Union Showplan Operator
Flow Distinct Showplan Operator
Partial Aggregate Showplan Operator
Aggregate Showplan Operator
ConceptsLogical and Physical Operators Reference
Understanding Hash Joins
Displaying Execution Plans by Using the Showplan SET Options (Transact-SQL)