Join ordering is the NP-hard problem of selecting the most efficient sequence in which to evaluate joins (conjunctive, binary operators) in a database query. As the performance of query execution critically depends on this choice, join ordering lies at the core of query optimization. Traditional approaches cast this problem as a discrete combinatorial search over binary trees guided by a cost model, but they often suffer from high computational complexity and limited scalability. We show that, when the cost model is differentiable, the query plans can be continuously relaxed into a soft adjacency matrix representing a superposition of plans. This continuous relaxation, together with a Gumbel-Softmax parameterization of the adjacency matrix and differentiable constraints enforcing plan validity, enables gradient-based search for plans within this relaxed space. Using a learned Graph Neural Network as the cost model, we demonstrate that this gradient-based approach can find comparable and even lower-cost plans compared to traditional discrete local search methods on two different graph datasets. Furthermore, we empirically show that the runtime of this approach scales linearly with query size, in contrast to quadratic or exponential runtimes of classical approaches. We believe this first step towards gradient-based join ordering can lead to more effective and efficient query optimizers in the future.


翻译:连接顺序优化是一个NP难问题,旨在为数据库查询中的连接(合取、二元操作符)选择最高效的评估序列。由于查询执行性能严重依赖于这一选择,连接顺序优化是查询优化的核心。传统方法将该问题视为基于成本模型的二叉树离散组合搜索,但通常面临计算复杂度高和可扩展性有限的问题。我们证明,当成本模型可微分时,查询计划可以连续松弛为一个表示计划叠加态的软邻接矩阵。这种连续松弛结合邻接矩阵的Gumbel-Softmax参数化以及确保计划有效性的可微分约束,使得在该松弛空间内进行基于梯度的计划搜索成为可能。通过使用学习型图神经网络作为成本模型,我们在两个不同图数据集上证明,这种基于梯度的方法能够找到与传统离散局部搜索方法相当甚至成本更低的计划。此外,实验表明该方法运行时间随查询规模呈线性增长,而经典方法通常具有二次或指数级时间复杂度。我们相信,这一基于梯度的连接顺序优化的初步探索,将为未来开发更高效、更强大的查询优化器奠定基础。

0
下载
关闭预览

相关内容

【CVPR2023】正则化二阶影响的持续学习
专知会员服务
19+阅读 · 2023年4月22日
【ICML2022】Sharp-MAML:锐度感知的模型无关元学习
专知会员服务
17+阅读 · 2022年6月10日
【CVPR2022】MSDN: 零样本学习的互语义蒸馏网络
专知会员服务
21+阅读 · 2022年3月8日
【NeurIPS2019】图变换网络:Graph Transformer Network
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Arxiv
18+阅读 · 2024年12月27日
Arxiv
176+阅读 · 2023年4月20日
A Survey of Large Language Models
Arxiv
501+阅读 · 2023年3月31日
Arxiv
13+阅读 · 2022年10月20日
Max-Margin Contrastive Learning
Arxiv
18+阅读 · 2021年12月21日
Arxiv
10+阅读 · 2021年3月30日
Memory-Gated Recurrent Networks
Arxiv
12+阅读 · 2020年12月24日
VIP会员
最新内容
乌克兰前线的五项创新
专知会员服务
2+阅读 · 今天6:14
 军事通信系统与设备的技术演进综述
专知会员服务
2+阅读 · 今天5:59
《北约标准:医疗评估手册》174页
专知会员服务
3+阅读 · 今天5:51
《提升生成模型的安全性与保障》博士论文
专知会员服务
3+阅读 · 今天5:47
美国当前高超音速导弹发展概述
专知会员服务
4+阅读 · 4月19日
无人机蜂群建模与仿真方法
专知会员服务
11+阅读 · 4月19日
澳大利亚发布《国防战略(2026年)》
专知会员服务
6+阅读 · 4月19日
全球高超音速武器最新发展趋势
专知会员服务
5+阅读 · 4月19日
相关论文
Arxiv
18+阅读 · 2024年12月27日
Arxiv
176+阅读 · 2023年4月20日
A Survey of Large Language Models
Arxiv
501+阅读 · 2023年3月31日
Arxiv
13+阅读 · 2022年10月20日
Max-Margin Contrastive Learning
Arxiv
18+阅读 · 2021年12月21日
Arxiv
10+阅读 · 2021年3月30日
Memory-Gated Recurrent Networks
Arxiv
12+阅读 · 2020年12月24日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员