arXiv:2412.01709cs.DBcs.CL2024-12被引 1

用大模型解释数据库查询为何在不同引擎中速度差异大

Query Performance Explanation through Large Language Model for HTAP Systems

  • 用树形卷积网络嵌入查询计划,快速检索历史经验
  • 基于知识库生成清晰的性能差异解释,比传统方法更易懂
  • 适合非专家用户和数据库优化人员参考

在混合事务与分析处理(HTAP)系统中,用户常困惑于同一查询在OLAP与OLTP引擎间性能差异显著。尽管优化器提供EXPLAIN功能展示执行计划,但其技术性过强,难以帮助非专家理解性能差异。为此,我们提出一种基于检索增强生成(RAG)的新型框架,构建包含历史查询执行记录与专家标注解释的知识库。通过轻量级树形卷积分类器对查询计划进行嵌入,实现高效知识检索,使大语言模型能够生成上下文感知、清晰易懂的性能对比解释。实验表明,该方法显著提升了查询性能解释的可读性与实用性,为数据库优化与用户支持提供了新路径。

原文摘要 · Abstract (English)

In hybrid transactional and analytical processing (HTAP) systems, users often struggle to understand why query plans from one engine (OLAP or OLTP) perform significantly slower than those from another. Although optimizers provide plan details via the EXPLAIN function, these explanations are frequently too technical for non-experts and offer limited insights into performance differences across engines. To address this, we propose a novel framework that leverages large language models (LLMs) to explain query performance in HTAP systems. Built on Retrieval-Augmented Generation (RAG), our framework constructs a knowledge base that stores historical query executions and expert-curated explanations. To enable efficient retrieval of relevant knowledge, query plans are embedded using a lightweight tree-CNN classifier. This augmentation allows the LLM to generate clear, context-aware explanations of performance differences between engines. Our approach demonstrates the potential of LLMs in hybrid engine systems, paving the way for further advancements in database optimization and user support.

数据库大模型查询优化

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