Lero: A Learning-to-Rank Query Optimizer

要約

最近の一連の作業では、機械学習技術を適用して、DBMS のコスト ベースのクエリ オプティマイザを支援または再構築しています。
一部のベンチマークでは優位性を示していますが、不安定なパフォーマンス、高いトレーニング コスト、遅いモデル更新などの欠点は、機械学習モデルを使用して実行計画のコストやレイテンシを予測することの本質的な難しさに起因しています。
このホワイト ペーパーでは、Lero と呼ばれるクエリ オプティマイザーをランク付けするための学習を紹介します。これは、ネイティブ クエリ オプティマイザーの上に構築され、クエリの最適化を改善するために継続的に学習します。
重要な観察結果は、クエリの最適化には、正確なコストや待機時間ではなく、計画の相対的な順序またはランクで十分であるということです。
Lero はペアワイズ アプローチを採用して分類器をトレーニングし、任意の 2 つの計画を比較して、どちらが優れているかを判断します。
このような 2 項分類タスクは、モデルの効率と有効性の観点から、回帰タスクよりもはるかに簡単にコストや待ち時間を予測できます。
Lero は、学習したオプティマイザーをゼロから構築するのではなく、数十年にわたるデータベースの知恵を活用し、ネイティブのオプティマイザーを改善するように設計されています。
邪魔にならない設計により、Lero は最小限の統合作業で既存の DBMS の上に実装できます。
Lero を実装し、PostgreSQL を使用してその優れたパフォーマンスを実証します。
私たちの実験では、Lero はいくつかのベンチマークでほぼ最適なパフォーマンスを達成しています。
ネイティブの PostgreSQL オプティマイザーの実行時間を最大 70% 短縮し、他の学習済みクエリ オプティマイザーの実行時間を最大 37% 短縮します。
一方、Lero は継続的に学習し、クエリのワークロードとデータの変化に自動的に適応します。

要約(オリジナル)

A recent line of works apply machine learning techniques to assist or rebuild cost based query optimizers in DBMS. While exhibiting superiority in some benchmarks, their deficiencies, e.g., unstable performance, high training cost, and slow model updating, stem from the inherent hardness of predicting the cost or latency of execution plans using machine learning models. In this paper, we introduce a learning to rank query optimizer, called Lero, which builds on top of the native query optimizer and continuously learns to improve query optimization. The key observation is that the relative order or rank of plans, rather than the exact cost or latency, is sufficient for query optimization. Lero employs a pairwise approach to train a classifier to compare any two plans and tell which one is better. Such a binary classification task is much easier than the regression task to predict the cost or latency, in terms of model efficiency and effectiveness. Rather than building a learned optimizer from scratch, Lero is designed to leverage decades of wisdom of databases and improve the native optimizer. With its non intrusive design, Lero can be implemented on top of any existing DBMS with minimum integration efforts. We implement Lero and demonstrate its outstanding performance using PostgreSQL. In our experiments, Lero achieves near optimal performance on several benchmarks. It reduces the execution time of the native PostgreSQL optimizer by up to 70% and other learned query optimizers by up to 37%. Meanwhile, Lero continuously learns and automatically adapts to query workloads and changes in data.

arxiv情報

著者 Rong Zhu,Wei Chen,Bolin Ding,Xingguang Chen,Andreas Pfadler,Ziniu Wu,Jingren Zhou
発行日 2023-02-14 07:31:11+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.AI, cs.DB パーマリンク