arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2311.17293cs.DB
收藏

在有基数估计与无基数估计情况下查询优化器性能分析

Analyzing Query Optimizer Performance in the Presence and Absence of Cardinality Estimates

Asoke Datta, Brian Tsan, Yesdaulet Izenov, Florin Rusu

AI总结:

本文通过JOB基准对比了有无基数估计的查询优化器在不同环境下的性能,发现基数估计在非索引环境中影响很小,在索引可用时可能导致次优物理算子,而在高并行主存数据库中影响较不显著。

摘要:

大多数查询优化器依赖基数估计来确定最优执行计划。虽然PostgreSQL、Oracle和Db2等传统数据库使用多种类型的概要结构——包括直方图、样本和sketch——但DuckDB和Heavy.AI等近期的主存数据库通常在极少或没有估计的情况下运行,而其性能未必受到影响。据我们所知,目前尚无对有基数估计和无基数估计的优化器进行分析比较,以理解它们在不同环境(如索引、非索引和多线程)下的性能特征。本文对有基数估计和无基数估计的优化器进行了对比分析。我们使用Join Order Benchmark(JOB)进行评估,并以真实基数作为基线。我们的研究表明,在非索引环境中基数估计的影响微乎其微。同时,当索引可用时,不准确的估计可能导致次优的物理算子——即使连接顺序是最优的。此外,在高度并行的主存数据库中,基数估计的影响较不显著。

英文摘要:

Most query optimizers rely on cardinality estimates to determine optimal execution plans. While traditional databases such as PostgreSQL, Oracle, and Db2 utilize many types of synopses -- including histograms, samples, and sketches -- recent main-memory databases like DuckDB and Heavy.AI often operate with minimal or no estimates, yet their performance does not necessarily suffer. To the best of our knowledge, no analytical comparison has been conducted between optimizers with and without cardinality estimates to understand their performance characteristics in different settings, such as indexed, non-indexed, and multi-threaded. In this paper, we present a comparative analysis between optimizers that use cardinality estimates and those that do not. We use the Join Order Benchmark (JOB) for our evaluation and true cardinalities as the baseline. Our investigation reveals that cardinality estimates have marginal impact in non-indexed settings. Meanwhile, when indexes are available, inaccurate estimates may lead to sub-optimal physical operators -- even with an optimal join order. Furthermore, the impact of cardinality estimates is less significant in highly-parallel main-memory databases.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑