SAP ASE versions 16.0 and later implement performance improvements and a reduction in resource usage for certain parallel query plans involving HASH JOIN operators.
SAP ASE 16.0 replaces the HASH JOIN operator with the HASH PROBE and the HASH BUILD operators, and includes the replicated EXCHANGE operator between these operators. The HASH BUILD operator builds the hash table and the HASH PROBE operator reads the inner stream and probes the hash table to find matching rows (in earlier releases of SAP ASE, the HASH JOIN operator performed both these steps).
A single worker thread executes the HASH BUILD operator, building a single hash table. The query engine passes this hash table through memory pipes to all producers executing the HASH PROBE operator. These producers share this hash table and probe it for matches to the joining columns in their inner streams. Earlier releases of SAP ASE required multiple producers to execute the HASH JOIN operator.
| | |EXCHANGE Operator (VA = 6) (Merged) | |Executed in parallel by 4 Producer and 1 Consumer processes. | | | | |EXCHANGE:EMIT Operator (VA = 5) | | | | | | |HASH JOIN Operator (VA = 4) (Join Type: Inner Join) | | | | Using Worktable1 for internal storage. | | | | Key Count: 1 | | | | | | | | |EXCHANGE Operator (VA = 2) (Replicated) | | | | |Executed in parallel by 1 Producer and 4 Consumer processes. | | | | | | | | | | |EXCHANGE:EMIT Operator (VA = 1) | | | | | |
If the query does not meet this criteria, the query processor uses the single HASH JOIN operator.
| | |EXCHANGE Operator (VA = 7) (Merged) | |Executed in parallel by 4 Producer and 1 Consumer processes. | | | | |EXCHANGE:EMIT Operator (VA = 6) | | | | | | |HASH JOIN PROBE Operator (VA = 5) (Join Type: Inner Join) | | | | Using Worktable2 for internal storage. | | | | Key Count: 1 | | | | | | | | |EXCHANGE Operator (VA = 3) (Replicated) | | | | |Executed in parallel by 1 Producer and 4 Consumer processes. | | | | | | | | | | |EXCHANGE:EMIT Operator (VA = 2) | | | | | | | | | | | | |HASH JOIN BUILD Operator (VA = 1) (Join Type: Inner Join) | | | | | | | Using Worktable1 for internal storage. | | | | | | | Key Count: 1 | | | | | | |