论文标题
有效的大量平行连接优化用于大量查询
Efficient Massively Parallel Join Optimization for Large Queries
论文作者
论文摘要
现代数据分析工作负载通常需要在大量表上进行查询。此类查询的最佳查询计划对于能够在可接受的时间范围内运行这些查询至关重要。但是,由于查询涉及许多表,找到最佳的联接顺序成为查询优化的瓶颈。由于连接订单优化的指数性质,优化器在阈值的表格数之后诉诸启发式解决方案。我们的目标是两个方面:(a)减少生成最佳计划的优化时间; (b)提高启发式解决方案的质量。在本文中,我们提出了一种新的大规模并行算法MPDP,该算法可以有效地修剪大型搜索空间(通过新的计划枚举技术),同时利用现代硬件(例如:GPU)提供的大量并行性。当对使用PostgreSQL的实际基准查询进行评估时,MPDP至少比最先进的大型分析查询技术要快的速度更快。结果,我们能够将启发式 - 倒倒数的限制从12个关系中提高到25个关系,并在PostgreSQL中具有同一时间预算。另外,为了处理更多表格的查询,我们将MPDP扩大到众所周知的启发式IDP $ _2 $(迭代DP版本2)和新颖的启发式UnionDP。通过系统地探索更大的搜索空间,这些启发式方法提供了与最先进的技术相比,这些查询计划的价格高达7倍,同时更快地计算。
Modern data analytical workloads often need to run queries over a large number of tables. An optimal query plan for such queries is crucial for being able to run these queries within acceptable time bounds. However, with queries involving many tables, finding the optimal join order becomes a bottleneck in query optimization. Due to the exponential nature of join order optimization, optimizers resort to heuristic solutions after a threshold number of tables. Our objective is two fold: (a) reduce the optimization time for generating optimal plans; and (b) improve the quality of the heuristic solution. In this paper, we propose a new massively parallel algorithm, MPDP, that can efficiently prune the large search space (via a novel plan enumeration technique) while leveraging the massive parallelism offered by modern hardware (Eg: GPUs). When evaluated on real-world benchmark queries with PostgreSQL, MPDP is at least an order of magnitude faster compared to state-of-the-art techniques for large analytical queries. As a result, we are able to increase the heuristic-fall-back limit from 12 relations to 25 relations with same time budget in PostgreSQL. Also, in order to handle queries with even larger number of tables, we augment MPDP to a well known heuristic, IDP$_2$ (iterative DP version 2) and a novel heuristic UnionDP. By systematically exploring a much larger search space, these heuristics provides query plans that are up to 7 times cheaper as compared to the state-of-the-art techniques while being faster to compute.