Skip to main content
QUICK REVIEW

[論文レビュー] Cardinality Estimation in DBMS: A Comprehensive Benchmark Evaluation

Yuxing Han, Zi‐Niu Wu|arXiv (Cornell University)|Sep 13, 2021
Advanced Database Systems and Queries参考文献 57被引用数 17
ひとこと要約

本論文は、データベース管理システム(DBMS)における基数推定(CardEst)の包括的ベンチマークであるCardEstを紹介し、実世界のデータセット(STATS)と多様なワークロード(STATS-CEB)を用いて、PostgreSQLにおける12種類の最先端手法を評価している。新たに提案された指標P-Errorは、従来のQ-Errorよりもエンドツーエンドのクエリ実行性能とより強く相関し、モデルの精度と推論効率が最適化性能に共同で寄与することを明らかにした。実際の運用では、データ駆動型の機械学習手法がクエリ駆動型の手法を上回ることが判明した。

ABSTRACT

Cardinality estimation (CardEst) plays a significant role in generating high-quality query plans for a query optimizer in DBMS. In the last decade, an increasing number of advanced CardEst methods (especially ML-based) have been proposed with outstanding estimation accuracy and inference latency. However, there exists no study that systematically evaluates the quality of these methods and answer the fundamental problem: to what extent can these methods improve the performance of query optimizer in real-world settings, which is the ultimate goal of a CardEst method. In this paper, we comprehensively and systematically compare the effectiveness of CardEst methods in a real DBMS. We establish a new benchmark for CardEst, which contains a new complex real-world dataset STATS and a diverse query workload STATS-CEB. We integrate multiple most representative CardEst methods into an open-source database system PostgreSQL, and comprehensively evaluate their true effectiveness in improving query plan quality, and other important aspects affecting their applicability, ranging from inference latency, model size, and training time, to update efficiency and accuracy. We obtain a number of key findings for the CardEst methods, under different data and query settings. Furthermore, we find that the widely used estimation accuracy metric(Q-Error) cannot distinguish the importance of different sub-plan queries during query optimization and thus cannot truly reflect the query plan quality generated by CardEst methods. Therefore, we propose a new metric P-Error to evaluate the performance of CardEst methods, which overcomes the limitation of Q-Error and is able to reflect the overall end-to-end performance of CardEst methods. We have made all of the benchmark data and evaluation code publicly available at https://github.com/Nathaniel-Han/End-to-End-CardEst-Benchmark.

研究の動機と目的

  • 実DBMSワークロードにおけるCardEst手法の体系的かつエンドツーエンドの評価が不足している問題を解決すること。
  • 特にQ-Errorのようなアルゴリズムレベルの指標に過度に依存している現状の評価慣行の欠陥を特定すること。
  • 複雑な実世界のDBMSシナリオを反映する現実的で、実データとクエリワークロードを備えた新規ベンチマークを確立すること。
  • エンドツーエンドの最適化性能に実際の影響をよりよく反映する新しい指標P-Errorを提案・検証すること。
  • 研究者らがより効果的で実用的かつスケーラブルなCardEst手法を設計するための実務的知見を提供すること。

提案手法

  • 実際のビジネスデータから得た高い歪度、相関関係、複雑なスキーマを有する実世界のベンチマークデータセット(STATS)を構築した。
  • 複数テーブルのジョイン、さまざまなジョインタイプ、選択的述語をカバーする多様なクエリワークロード(STATS-CEB)を設計した。
  • 従来型、クエリ駆動型、データ駆動型の機械学習モデルを含む12種類の代表的なCardEst手法を、オープンソースのPostgreSQLに統合した。
  • P-Errorを新たな評価指標として提案。この指標は、計画コストに与える影響に基づきサブプランの誤差を集約し、エンドツーエンドの最適化性能を反映する。
  • クエリ実行時間、推論遅延、モデルサイズ、学習時間、更新効率を測定するエンドツーエンドの評価を実施した。
  • P-ErrorとQ-Errorを実際のクエリ実行時間と相関分析し、P-Errorの優位性を検証した。

実験結果

リサーチクエスチョン

  • RQ1高度なCardEst手法は、実世界のDBMS環境においてクエリ最適化性能をどの程度向上させるか?
  • RQ2Q-Errorのような従来のアルゴリズムレベルの指標は、実際のエンドツーエンドのクエリ性能をどの程度適切に反映しているか?
  • RQ3推定精度、推論速度、更新効率のバランスが取れた、動的DBMSにおいて最適なCardEst手法は何か?
  • RQ4さまざまなサブプランの推定誤差は、最終的なクエリ計画の品質と実行時間にどのように影響するか?
  • RQ5P-Errorのような新しい指標は、Q-Errorよりも実世界のクエリ性能をよりよく予測できるか?

主な発見

  • P-Errorは実際のクエリ実行時間と強い相関(50–90百分位数で0.810–0.838)を示したのに対し、Q-Errorはほぼゼロの相関(0.036–0.037)を示し、P-Errorが実性能の予測に優れていることを実証した。
  • FLAT、DeepDB、BayesCardなどのデータ駆動型機械学習ベースのCardEst手法は、モデルの表現力と推論効率のバランスを取ることで、エンドツーエンドのクエリ性能を顕著に向上させた。
  • クエリ駆動型機械学習ベースの手法は、スケーラビリティの低さと高い推論コストのため、PostgreSQLのベースラインと比べてほとんど改善が見られなかった。
  • 従来型手法や一部のデータ駆動型モデル(例:PessEst、BayesCard)は、高速な更新が可能であり、動的かつリアルタイムなDBMSワークロードにおいて実用的である。
  • 4–5テーブルを超える多テーブルジョインクエリでは、大規模なデータ駆動型モデルの性能が著しく低下した。
  • Q-Errorを最適化しても、高基数サブプランでの誤差が計画品質に顕著に影響を与えるため、より良い計画が保証されないことが明らかになった。

より良い研究を、今すぐ始めましょう

論文の読解から最終レビューまで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。