arXiv:2411.02862cs.DBcs.LG2024-11被引 20

用大模型嵌入优化数据库查询,简单有效。

The Unreasonable Effectiveness of LLMs for Query Optimization

  • 用大模型对查询语句做嵌入,提取语义信息
  • 仅需少量标注数据,分类器性能超过传统启发式系统
  • 适合追求简单高效查询优化的工程师

近期数据库查询优化研究采用复杂的机器学习策略,如定制化强化学习。令人意外的是,我们发现大模型对查询文本的嵌入中包含对查询优化有用的信息。具体而言,仅使用少量标注的嵌入查询向量训练一个简单的二分类器,即可在选择替代查询计划时表现优于现有启发式系统。尽管目前仅为初步结果,但基于大模型的查询优化器在性能与实现复杂度上均可能带来显著优势。

原文摘要 · Abstract (English)

Recent work in database query optimization has used complex machine learning strategies, such as customized reinforcement learning schemes. Surprisingly, we show that LLM embeddings of query text contain useful semantic information for query optimization. Specifically, we show that a simple binary classifier deciding between alternative query plans, trained only on a small number of labeled embedded query vectors, can outperform existing heuristic systems. Although we only present some preliminary results, an LLM-powered query optimizer could provide significant benefits, both in terms of performance and simplicity.

查询优化大模型数据库

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。