Abstract:HHJ is one of the mostly used core join algorithms for query processing in a database management system. This paper proposes a buffer-optimized hybrid hash join algorithm(OHHJ) by optimizing the bucket buffer to reduce the random I/O in hash join, i.e., to minimize the random I/O by optimizing the bucket buffer size in partition phase. By quantitatively analyzing the relationship between the bucket size, bucket buffer size, available memory size, relation size and random I/O access characteristics of hard disk, we have derived the heuristics for allocating the optimal bucket and bucket buffer sizes. The experimental results demonstrate that OHHJ can effectively reduce random I/O in HHJ during partition phase, and thus enhance the performance of the algorithm.