华东师范大学学报(自然科学版) ›› 2022, Vol. 2022 ›› Issue (5): 48-60.doi: 10.3969/j.issn.1000-5641.2022.05.005

• 区块链系统与数据管理 • 上一篇    下一篇

查询优化器连接顺序评估

陈婷, 项兆坤, 徐金凯, 张蓉*()   

  1. 华东师范大学 数据科学与工程学院, 上海 200062
  • 收稿日期:2022-07-11 出版日期:2022-09-25 发布日期:2022-09-26
  • 通讯作者: 张蓉 E-mail:rzhang@dase.ecnu.edu.cn
  • 基金资助:
    国家科学自然基金 (62072179); CCF-华为数据库创新研究计划

Benchmarking join order selection of query optimizers

Ting CHEN, Zhaokun XIANG, Jinkai XU, Rong ZHANG*()   

  1. School of Data Science and Engineering, East China Normal University, Shanghai 200062, China
  • Received:2022-07-11 Online:2022-09-25 Published:2022-09-26
  • Contact: Rong ZHANG E-mail:rzhang@dase.ecnu.edu.cn

摘要:

连接顺序选择问题, 即从连接顺序搜索空间中选出性能最优的连接顺序, 是关键的查询优化问题. 然而, 连接顺序的选择存在庞大的搜索空间, 导致其成为难点问题, 优化器往往无法确保找到最佳的连接顺序. 虽然目前存在许多连接顺序选择策略, 但是, 现有的评测基准不适用于评估各种连接顺序选择策略的优劣. 为了有效地评估优化器在连接顺序选择方面的优化效果, 本文基于确定性数据生成方法, 采用适用于不同连接形状的连接模板生成算法和基于结果导向的参数实例化方法, 生成评测场景的数据与负载, 实现了通用的优化器连接顺序选择评估工具. 通过对OceanBase和PostgreSQL进行评测, 表明本文所提出的工具能够全面且有效地评估查询优化器的连接顺序选择功能的性能.

关键词: 分析型数据库, 查询处理, 查询优化, 连接顺序选择

Abstract:

Join order selection, i.e., the determination of the cheapest join order from available alternatives, is one of the most critical tasks in query optimization. The enormous search space of a join order makes it difficult to find an optimal join order in an efficient manner. Although there are many optimization algorithms for join order selection, existing benchmarks are unsuitable for evaluating these join order selection strategies because they cannot configure the depths of the joins or cover all join styles. To effectively evaluate the quality of join order selection algorithms used in an optimizer, a generic evaluation tool for join order selection is implemented in this study. The tool takes the primary key-based deterministic data generation method for portable application scenario migration, a join order sampling algorithm to reduce the investigated join spaces, and a result-guided parameter instantiation algorithm to support a valid query generation. We applied the tool on OceanBase and PostgreSQL, and the experiment results show its effectiveness in evaluating the performance of join order selection in query optimizers in a generic and efficient manner.

Key words: online analytical processing database, query processing, query optimization, join order selection

中图分类号: