arXiv:2608.20630cs.AI2026-08

统一处理SQL中AI函数的执行框架,显著提升效率与质量。

SAGE: A Unified Algebra and Self-Adaptive Execution for AI Functions in SQL

论文配图:SAGE: A Unified Algebra and Self-Adaptive Execution for AI Functions in SQL
图 1 · 摘自论文原文
  • 用三种类型原语统一建模AI函数的三种关系操作
  • 在典型任务上实现最高语义基准性能,减少超200倍模型调用
  • 适合需要高效集成AI功能的数据库系统开发者

SQL系统越来越多地引入AI函数,用于分类、提取、过滤、排序、检索、连接和摘要等任务。尽管这些函数接口各异,但仅承担三种关系角色:单行转换、分组聚合或行对关系生成。本文提出SAGE(自适应生成执行)框架,以三种带类型的原语——AI_SCALAR、AI_AGG和AI_JOIN——统一捕捉这些角色,并与标准关系算子自然组合。所有原语共享置信度门控执行接口,同时支持针对其关系结构定制的物理策略。核心挑战在于AI_JOIN,SAGE通过分析谓词、在可能时分解复合条件,并结合小规模无标签探测与策略卡,自动选择最优执行方案。在涵盖多种公开AI算子的广泛审计及标量、聚合、连接工作负载评估中,该框架覆盖常见AI功能,持续提升执行质量与效率。SAGE在整体语义基准测试中表现最强,且在代表性可分解连接任务中,将成对模型调用减少超过两个数量级,实测成本降低358倍。

原文摘要 · Abstract (English)

SQL systems increasingly expose AI functions for tasks such as classification, extraction, filtering, ranking, retrieval, joining, and summarization. Despite their diverse APIs, these functions play only three relational roles: transforming individual rows, aggregating groups, or generating relationships between row pairs. We present SAGE (Self-Adaptive Generative Execution), a unified logical and physical framework that captures these roles with three typed primitives, AI_SCALAR, AI_AGG, and AI_JOIN, and composes them naturally with standard relational operators. All primitives share a confidence-gated execution interface while supporting physical strategies tailored to their relational shape. The main challenge is AI_JOIN, where SAGE analyzes the predicate, decomposes compound conditions when possible, and uses a recipe card together with a small label-free probe to select among complete execution strategies. Across a broad audit of public AI operators and evaluations spanning scalar, aggregate, and join workloads, this formulation covers common AI functionality while consistently improving execution quality and efficiency. SAGE achieves the strongest overall SemBench performance and, on a representative factorable join, reduces pairwise model calls by more than two orders of magnitude, yielding a 358-fold measured cost reduction.

SQL优化AI集成执行引擎

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