Cortex AISQL: A Production SQL Engine for Unstructured Data

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Liskowski, Paweł, Han, Benjamin, Aggarwal, Paritosh, Chen, Bowei, Jiang, Boxin, Jindal, Nitish, Li, Zihan, Lin, Aaron, Schmaus, Kyle, Tayade, Jay, Zhao, Weicheng, Datta, Anupam, Wiegand, Nathan, Tsirogiannis, Dimitris
Format: Preprint
Veröffentlicht: 2025
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866911572960477184
author Liskowski, Paweł
Han, Benjamin
Aggarwal, Paritosh
Chen, Bowei
Jiang, Boxin
Jindal, Nitish
Li, Zihan
Lin, Aaron
Schmaus, Kyle
Tayade, Jay
Zhao, Weicheng
Datta, Anupam
Wiegand, Nathan
Tsirogiannis, Dimitris
author_facet Liskowski, Paweł
Han, Benjamin
Aggarwal, Paritosh
Chen, Bowei
Jiang, Boxin
Jindal, Nitish
Li, Zihan
Lin, Aaron
Schmaus, Kyle
Tayade, Jay
Zhao, Weicheng
Datta, Anupam
Wiegand, Nathan
Tsirogiannis, Dimitris
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2511_07663
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Cortex AISQL: A Production SQL Engine for Unstructured Data
Liskowski, Paweł
Han, Benjamin
Aggarwal, Paritosh
Chen, Bowei
Jiang, Boxin
Jindal, Nitish
Li, Zihan
Lin, Aaron
Schmaus, Kyle
Tayade, Jay
Zhao, Weicheng
Datta, Anupam
Wiegand, Nathan
Tsirogiannis, Dimitris
Databases
Artificial Intelligence
Machine Learning
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.
title Cortex AISQL: A Production SQL Engine for Unstructured Data
topic Databases
Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2511.07663