MariaDB 5.3/5.5 has introduced a new join type “Hash Joins” which is an implementation of a Classic Block-based Hash Join Algorithm. In this post we will see what the Hash Join is, how it works and for what types of queries would it be the right choice. I will show the results of executing benchmarks for different queries and explain the results so that you have a better understanding of when using the Hash Join will be best and when not. Although Hash Joins are available since MariaDB 5.3, but I will be running my benchmarks on the newer MariaDB 5.5.
Overview
Hash Join is a new algorithm introduced in MariaDB 5.3/5.5 that
can be used for joining tables that have a equijoin conditions of
the form tbl1.col1 = tbl2.col1, etc. As I mentioned above that
what is actually implemented is the Classic Hash Join. But its
known as Block Nested Loop Hash (BNLH) Join in
MariaDB.
The Classic Hash Join Algorithm …