arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2608.20630cs.AI

SAGE:用于SQL中AI函数的统一代数与自适应执行

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

Xiangqi Wang

首次发表
浏览论文内容

中文总结 AI 辅助

研究针对SQL中AI函数的执行问题,提出SAGE框架,通过三个类型化原语统一AI函数的关系角色,实现了SemBench性能提升,还大幅降低了可分解连接的模型调用与执行成本。

中文摘要 AI 辅助

SQL系统日益为分类、提取、过滤、排序、检索、连接和汇总等任务暴露AI函数。尽管这些函数的API各不相同,但它们仅扮演三种关系角色:转换单个行、聚合分组或生成行对之间的关系。我们提出SAGE(自适应生成执行,Self-Adaptive Generative Execution),这是一个统一的逻辑和物理框架,通过三个类型化原语(AI_SCALAR、AI_AGG和AI_JOIN)来捕获这些角色,并将它们与标准关系运算符自然组合。所有原语共享置信度门控执行接口,同时支持针对其关系形状定制的物理策略。主要挑战在于AI_JOIN,SAGE会分析谓词,在可能时分解复合条件,并使用“配方卡”结合小型无标签探针在完整执行策略中进行选择。在对公共AI运算符的广泛审查以及涵盖标量、聚合和连接工作负载的评估中,这种表述涵盖了常见的AI功能,同时持续提升执行质量和效率。SAGE在SemBench上实现了最强的整体性能,在一个具有代表性的可分解连接上,将成对模型调用减少了两个数量级以上,实现了358倍的实测成本降低。

英文摘要

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.

补充信息

↑