计算机应用 ›› 2016, Vol. 36 ›› Issue (1): 13-20.DOI: 10.11772/j.issn.1001-9081.2016.01.0013

• 第32届中国数据库学术会议(NDBC 2015) • 上一篇    下一篇

基于Supersonic的并行分组聚集

张兵1,2, 孙辉1,2, 范旭1,2, 李翠平1,2, 陈红1,2, 王雯1,2   

  1. 1. 数据工程与知识工程教育部重点实验室(中国人民大学), 北京 100872;
    2. 中国人民大学 信息学院, 北京 100872
  • 收稿日期:2015-09-15 修回日期:2015-10-12 出版日期:2016-01-10 发布日期:2016-01-09
  • 通讯作者: 孙辉(1977-),女,山东青岛人,讲师,博士,主要研究方向:高性能数据库、数据挖掘
  • 作者简介:张兵(1989-),男,湖北随州人,硕士研究生,主要研究方向:面向协处理器的数据库存储和查询处理、基于多核的数据库性能;范旭(1990-),男,河北邯郸人,硕士研究生,主要研究方向:基于OLAP系统的数据查询方法、装置及系统。

Supersonic-based parallel group-by aggregation

ZHANG Bing1,2, SUN Hui1,2, FAN Xu1,2, LI Cuiping1,2, CHEN Hong1,2, WANG Wen1,2   

  1. 1. Key Laboratory of Data Engineering and Knowledge Engineering, Ministry of Education (Renmin University of China), Beijing 100872, China;
    2. School of Information, Renmin University of China, Beijing 100872, China
  • Received:2015-09-15 Revised:2015-10-12 Online:2016-01-10 Published:2016-01-09

摘要: 针对在分析型联机分析处理(OLAP)应用中频繁出现的数据密集型操作符——分组聚集耗时较多的问题,提出Cache友好的分组聚集算法对该操作进行性能优化。首先,为充分发挥列存储在数据密集型计算方面的优势,采用基于开源的列存储查询执行引擎Supersonic,并在此之上设计Cache友好的分组聚集算法;其次,为加速查询的执行,使用并行技术,将单线程的分组聚集算法改为多线程并行的分组聚集算法。基于Supersonic设计并实现4种并行分组聚集算法:无共享Hash表并行分组聚集(NSHPGA)算法、表锁共享Hash表并行分组聚集(TLSHPGA)算法、桶锁共享Hash表并行分组聚集(BLSHPGA)算法、节点锁共享Hash表并行分组聚集(NLSHPGA)算法,且在不同的分组势集、不同的线程数的情况下,针对上述4种算法做了多组实验。通过对比3种不同粒度的共享Hash表并行分组聚集算法的加速比,得出NLSHPGA算法在加速比和并发度两方面表现最好,部分查询可达到10倍加速比;通过比较NSHPGA算法和NLSHPGA算法的加速比、Cache miss内存使用等情况,得出NLSHPGA算法在分组势集大于8时,加速比超过NSHPGA算法,并且Cache miss更低,使用的内存更少。

关键词: 并行分组聚集, Supersonic, 节点锁, 列存储, cache友好

Abstract: To solve the time-consuming problem of group-by aggregation operation in case of data-intense computation, a cache-friendly group-by aggregation method was proposed. In this paper, the group-by aggregation operation was optimized in two aspects. Firstly, designing cache-friendly group-by aggregation algorithm on Supersonic, an open-source and column-oriented query execution engine, to take the full advantage of column-storage on in-memory computation. Secondly, rewriting the algorithm with multi-threads to speed up the query. In this paper, four different parallel aggregation algorithms were put forward, respectively named Shared-Nothing Parallel Group-by Aggregation (NSHPGA) algorithm, Table-Lock Shared-Hash Parallel Group-by Aggregation (TLSHPGA) algorithm, Bucket-Lock Shared-Hash Parallel Group-by Aggregation (BLSHPGA) algorithm and Node-Lock Shared-Hash Parallel Group-by Aggregation (NLSHPGA) algorithm. Through a series of comparison experiment on different group power set and different number of worker threads, NLSHPGA algorithm was proved to have the best performance both on speed-up ratio and concurrency, which achieved 10x speedups on part of queries. Besides, considering Cache miss and memory utilization, the results shows that NSHPGA algorithm is suitable for smaller group power set, which was 8 in the experiment, and when getting larger, NLSHPGA algorithm performs better than NSHPGA algorithm.

Key words: parallel group-by aggregation, Supersonic, node-lock, column storage, cache-friendly

中图分类号: