Query optimization remains one of the most challenging problems in data management systems. Recent efforts to apply machine learning techniques to query optimization challenges have been promising, but have shown few practical gains due to substantive training overhead, inability to adapt to changes, and poor tail performance. Motivated by these difficulties and drawing upon a long history of research in multi-armed bandits, we introduce Bao (the BAndit Optimizer). Bao takes advantage of the wisdom built into existing query optimizers by providing per-query optimization hints. Bao combines modern tree convolutional neural networks with Thompson sampling, a decades-old and well-studied reinforcement learning algorithm. As a result, Bao automatically learns from its mistakes and adapts to changes in query workloads, data, and schema. Experimentally, we demonstrate that Bao can quickly (an order of magnitude faster than previous approaches) learn strategies that improve end-to-end query execution performance, including tail latency. In cloud environments, we show that Bao can offer both reduced costs and better performance compared with a sophisticated commercial system.
翻译:查询优化仍然是数据管理系统中最具挑战性的问题之一。最近应用机器学习技术以查询优化挑战的努力是大有希望的,但是由于实质性培训间接费用、无法适应变化和尾部性能差等原因几乎没有实际的成果。受这些困难的驱使并借鉴了对多武装匪徒的长期研究历史,我们引入了 Bao (Bandit Optimerizer) 。Bao 通过提供每克优化提示,利用现有查询优化的智慧。Bao 将现代树神经网络与Thompson取样、一个长达数十年且经过良好研究的强化学习算法相结合。因此,Bao 自动从错误中学习,适应查询工作量、数据及机制的变化。我们实验性地证明,Bao 能够快速(规模比以往方法快得多) 学习提高端对端查询执行能力的战略,包括尾部拉。在云环境中,我们显示,与复杂的商业系统相比,Bao可以降低成本,提高性能。