Joining in DB2 UDB
In the previous version of DB2, the DB2 optimizer would normally choose between two different join methods: a nested loop join and a merge join. However, in DB2 Version 7, when the DB2_HASH_JOIN registry variable was set to YES, the optimizer was also able to consider using a hash join when optimizing the access plan. Because hash joins can significantly improve the performance of certain queries, especially in DSS environments where the queries are normally quite large and complex, hash joins are always available in DB2 UDB Version 8 but are considered only when the optimization level is five or higher.
NOTE
To disable the optimizer from considering hash joins, set the DB2_HASH_JOIN registry variable to NO.
Join Methods
Get Advanced DBA Certification Guide and Reference for DB2® Universal Database™ v8 for Linux®, UNIX®, and Windows® now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.