FAITH: A Fast, Accurate, and Lightweight Database-Agnostic Learned Cost Model
摘要
In recent years, there has been a notable rise in the application of machine learning to cost estimation for query optimization. Central to an effective cost model are the abilities of accuracy, efficiency, lightness, and generalizability. However, traditional cost models are based on heuristics thus lack of accuracy. On the other hand, the learned cost models frequently struggle to strike a balance between accuracy and efficiency, with many lacking broad applicability. To combat these challenges, we introduce FAITH, a fast, accurate, and database-agnostic learned cost model. FAITH harnesses data from multiple sources to learn cross-database meta-knowledge. It is then effectively refined, leveraging the unique data information from the target database via an Adapter we developed. Proven through various benchmarks, FAITH consistently showcases its prowess in delivering accurate and robust cost estimations.