Snowflake's Cortex AISQL is a production SQL engine that integrates native semantic operations directly into SQL. This integration allows users to write declarative queries that combine relational operations with semantic reasoning, enabling them to query both structured and unstructured data effortlessly. However, making semantic operations efficient at production scale poses fundamental challenges. Semantic operations are more expensive than traditional SQL operations, possess distinct latency and throughput characteristics, and their cost and selectivity are unknown during query compilation. Furthermore, existing query engines are not designed to optimize semantic operations. The AISQL query execution engine addresses these challenges through three novel techniques informed by production deployment data from Snowflake customers. First, AI-aware query optimization treats AI inference cost as a first-class optimization objective, reasoning about large language model (LLM) cost directly during query planning to achieve 2-8$\times$ speedups. Second, adaptive model cascades reduce inference costs by routing most rows through a fast proxy model while escalating uncertain cases to a powerful oracle model, achieving 2-6$\times$ speedups while maintaining 90-95% of oracle model quality. Third, semantic join query rewriting lowers the quadratic time complexity of join operations to linear through reformulation as multi-label classification tasks, achieving 15-70$\times$ speedups with often improved prediction quality. AISQL is deployed in production at Snowflake, where it powers diverse customer workloads across analytics, search, and content understanding.


翻译:Snowflake的Cortex AISQL是一种生产级SQL引擎,它将原生语义操作直接集成到SQL中。这种集成使用户能够编写结合关系操作与语义推理的声明式查询,从而轻松查询结构化和非结构化数据。然而,在规模化生产环境中高效执行语义操作面临着根本性挑战。语义操作比传统SQL操作更昂贵,具有不同的延迟和吞吐量特性,其成本和选择性在查询编译时是未知的。此外,现有查询引擎并非为优化语义操作而设计。AISQL查询执行引擎通过借鉴Snowflake客户的真实生产部署数据,采用三种新颖技术解决了这些挑战。首先,AI感知的查询优化将AI推理成本作为首要优化目标,在查询规划阶段直接考量大型语言模型(LLM)的成本,实现了2-8倍的加速。其次,自适应模型级联通过将大多数行路由到快速代理模型,同时将不确定案例升级至强大的预言模型,从而降低推理成本,在保持90-95%预言模型质量的同时实现了2-6倍的加速。第三,语义连接查询重写将连接操作的二次时间复杂度通过重写为多标签分类任务降低至线性,实现了15-70倍的加速,并通常提升了预测质量。AISQL已在Snowflake的生产环境中部署,支持涵盖分析、搜索和内容理解等领域的多样化客户工作负载。

0
下载
关闭预览

相关内容

AI原生数据库发展趋势白皮书
专知会员服务
18+阅读 · 5月16日
工行基于MySQL构建分布式架构的转型之路
炼数成金订阅号
15+阅读 · 2019年5月16日
【大数据】StreamSets:一个大数据采集工具
产业智能官
40+阅读 · 2018年12月5日
TextInfoExp:自然语言处理相关实验(基于sougou数据集)
全球人工智能
12+阅读 · 2017年11月12日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
7+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
11+阅读 · 2012年12月31日
Arxiv
0+阅读 · 4月8日
Arxiv
0+阅读 · 3月2日
VIP会员
相关主题
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
6+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
7+阅读 · 6月17日
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
4+阅读 · 6月17日
相关VIP内容
AI原生数据库发展趋势白皮书
专知会员服务
18+阅读 · 5月16日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
7+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
11+阅读 · 2012年12月31日
Top
微信扫码咨询专知VIP会员