Traditional query optimizers are designed to be fast and stateless: each query is quickly optimized using approximate statistics, sent off to the execution engine, and promptly forgotten. Recent work on learned query optimization have shown that it is possible for a query optimizer to "learn from its mistakes," correcting erroneous query plans the next time a plan is produced. But what if query optimizers could avoid mistakes entirely? This paper presents the idea of learned query superoptimization. A new generation of query superoptimizers could autonomously experiment to discover optimal plans using exploration-driven algorithms, iterative Bayesian optimization, and program synthesis. While such superoptimizers will take significantly longer to optimize a given query, superoptimizers have the potential to massively accelerate a large number of important repetitive queries being executed on data systems today.
翻译:传统的查询优化器旨在快速且无状态:每个查询都使用近似统计数据快速优化,然后发送到执行引擎,并立即忘记。最近,有关学习查询优化的研究表明,查询优化器可以“从错误中学习”,下次生成计划时纠正错误的查询计划。但是,如果查询优化器可以完全避免错误怎么办?本文提出了学习查询超级优化的想法。新一代查询超级优化器可以使用基于探索的算法、迭代贝叶斯优化和程序综合自主地进行实验,以发现最佳计划。虽然这样的超级优化器会花费更长的时间来优化一个给定的查询,但超级优化器有可能大大加速今天在数据系统上执行的大量重复查询。