AI 中文总结
本文通过轻量级智能体搜索发现7个DBMS中均存在规划耗时超3分钟的查询,分析其异常模式并公开相关查询及测试套件,指出查询规划的延迟与鲁棒性需重视。
AI 中文摘要
查询规划器通常被期望能快速生成优化后的执行计划,这使得许多研究者(包括本文作者)和从业者设计的系统都假设查询规划是一项低成本操作。本文采用轻量级智能体搜索方法,证明该假设并非总是成立。在7个数据库管理系统(DBMS)中,包括4个商业系统,我们发现每个系统至少存在一个查询,其规划耗时超过3分钟。这类查询不仅规划缓慢,还可能在未执行有效工作的情况下占用数据库资源,形成潜在的拒绝服务攻击向量。我们分析了搜索发现的查询,并比较了7个系统对每种查询模式的响应。研究发现,触发缓慢规划的查询虽在很大程度上具有DBMS特异性,但涉及关联子查询、公共表表达式(CTE)扩展、重复子查询表达式、析取连接和常量折叠的反复异常模式会影响多个系统。我们公开了所发现的查询,以及一套精心整理的参数化查询异常模式,供研究者和数据库工程师测试规划器的鲁棒性。总体而言,研究结果表明查询规划不能总是被视为可预测的低成本操作,其延迟和鲁棒性值得数据库研究者和工程师进一步关注。
英文摘要
Query planners are typically expected to produce optimized plans quickly, leading many researchers (including the authors of this paper) and practitioners to design systems that assume query planning is a low-cost operation. Using a lightweight agentic search, we show that this assumption does not always hold. Across seven DBMSes, including four commercial systems, we find at least one query per system that takes more than three minutes to plan. In addition to being slow to plan, such queries risk tying up database resources without performing useful work, creating a potential denial-of-service vector. We analyze the queries our search uncovers and compare how the seven systems respond to each pattern. We find that although the queries triggering slow planning are largely DBMS-specific, recurring pathologies involving correlated subqueries, CTE expansion, repeated subquery expressions, disjunctive joins, and constant folding affect multiple systems. We release our uncovered queries along with a curated suite of parameterized query pathologies that researchers and database engineers can use to test planner robustness. Overall, our results show that query planning cannot always be treated as a predictably inexpensive operation and that its latency and robustness deserve further attention from both database researchers and engineers.
Comments7 pages, 9 figures