Performance Evaluation of Hash Join Algorithm on Flash Memory SSDs

플래쉬 메모리 SSD 기반 해쉬 조인 알고리즘의 성능 평가

  • 박장우 (성균관대학교 임베디드 소프트웨어학과) ;
  • 박상신 (성균관대학교 임베디드 소프트웨어학과) ;
  • 이상원 (성균관대학교 정보통신공학부) ;
  • 박찬익 (삼성전자 Flash WS 그룹)
  • Received : 2010.06.25
  • Accepted : 2010.09.13
  • Published : 2010.11.15

Abstract

Hash join is one of the core algorithms in databases management systems. If a hash join cannot complete in one-pass because the available memory is insufficient (i.e., hash table overflow), however, it may incur a few sequential writes and excessive random reads. With harddisk as the tempoary storage for hash joins, the I/O time would be dominated by slow random reads in its probing phase. Meanwhile, flash memory based SSDs (flash SSDs) are becoming popular, and we will witness in the foreseeable future that flash SSDs replace harddisks in enterprise databases. In contrast to harddisk, flash SSD without any mechanical component has fast latency in random reads, and thus it can boost hash join performance. In this paper, we investigate several important and practical issues when flash SSD is used as tempoary storage for hash join. First, we reveal the va patterns of hash join in detail and explain why flash SSD can outperform harddisk by more than an order of magnitude. Second, we present and analyze the impact of cluster size (i.e., va unit in hash join) on performance. Finally, we emperically demonstrate that, while a commerical query optimizer is error-prone in predicting the execution time with harddisk as temporary storage, it can precisely estimate the execution time with flash SSD. In summary, we show that, when used as temporary storage for hash join, flash SSD will provide more reliable cost estimation as well as fast performance.

데이터베이스 관리 시스템의 핵심 알고리즘인 해쉬 조인은 해싱을 위한 메모리가 부족한 경우(즉, 해쉬 테이블 오버플로우) 디스크 입출력를 유발하게 된다 하드디스크를 임시 저장공간으로 사용할 경우, 해쉬 조인의 probing 단계에서 과도한 임의 읽기로 인해 I/O 시간이 성능을 저하시키게 된다. 한편, 플래시메모리 SSD가 저장장치로 각광을 받고 있으며, 머지않아 엔터프라이즈 환경에서 하드디스크를 대체할 것으로 예상 된다 하드디스크와 달리, 기계적인 동작 장치가 없는 플래시메모리 SSD의 경우 임의 읽기에서 빠른 성능을 보이기 때문에 해쉬 조인의 성능을 크게 향상시킬 수 있다. 본 논문에서는 플래시 메모리 SSD를 해쉬 조인을 위한 임시 저장공간으로 사용할 경우의 몇 가지 중요하고 현실적인 이슈들을 다룬다. 우선, 해쉬 조인의 I/O 패턴을 자세히 설명하고, 하드디스크에 비해 플래시메모리 SSD가 수십 배에 가까운 성능 향상을 보이는 이유를 설명한다. 다음으로, 클러스터 크기(즉, 해쉬 조인 알고리즘에서 사용하는 I/O 단위)가 성능에 미치는 영향을 제시하고 분석한다. 마지막으로, 하드디스크의 경우, DBMS의 질의 최적화기가 산출하는 비용이 실 수행시간과 편차가 클 수 있는데 반해, 플래시메모리 SSD의 경우 비용 산출을 정확히 하게 됨을 실험적으로 보인다. 결론적으로, 플래시메모리 SSD를 해쉬 조인을 위한 임시 저장공간으로 사용할 경우, 빠른 성능과 더불어 질의 최적화기의 비용 산출이 훨씬 더 신뢰할 수 있음을 보인다.

Keywords

References

  1. L.D.Shapiro, "Join processing in database systems with large main memories," ACM Trans.Database Syst., vol.11, no.3, pp.239-264, 1986. https://doi.org/10.1145/6314.6315
  2. Hansjorg Zeller, Jim Gray, TANDEM COMPUTERS, "Hash join algorithms in a multiuser environment," technical report 90.4, Fed. 1990.
  3. G. Grafe, A. Linville, and L.D.Shapiro, "Sort versus hash revisited," IEEE Transactions on Knowledge and Data Engineering, vol.6, no.6, pp. 934-944, 1994. https://doi.org/10.1109/69.334883
  4. S.-W. LEE, B. Moon, C. Park, J.-M. Kim, and S.-W. Kim, "A case for flash memory ssd in enterprise database applications," in SIGMOD '08: Proceedings of the 2008 ACM SIGMOD international conference on Management of data, pp. 1075-1086, 2008.
  5. G.Graefe, Univ.of Colorado, Boulder, USA, Dept. Comput. Sci., "Parallel external sorting in volcano," technical report 459, June 1990.
  6. Center of Expertise, Oracle Worldwide Customer Support., "Hash joins, implementation and tuning release 7.3," technical report, Mar. 1997.
  7. Oracle, "Oracle enterprise manager database tuning with the oracle tuning pack," http:;/download.oracle.com/docs/B1050101/em.920/ a86647/index.htm.
  8. S. W.Schlosser, J Schindler, S. Papado-manolakis, M. Shao, A. Ailamaki, and G. R.Christos Faloutsos, "On multidimensional data and modem disks," Proceedings of the 4th coriference on USENIX Coriference on File and Storage Technologies - voI.4,pp.225-238, 2005.
  9. J Do and J. M.Patel, "Join processing for flash ssds:remembering past lessons," Data Management On New Hardware, pp.1-8, 2009.
  10. L. M.Haas, M. J.Carey, M. Livny, and A. Shukla, "Sing the truth about ad hoc join costs," The VLDB journal-The International journal on Very Lar ge Data Bases, vol.6, no.3, pp.241-256, 1997. https://doi.org/10.1007/s007780050043
  11. "blktrace." http://linux.die.net/man/8/blktrace.
  12. "seekwatcher." http://oss.oracle.com/mason/seekwatcher