Factorized and Vectorized Execution: Optimizing Analytical and Semantic Queries over Relations
Sunny Yasser, Anas Dorbani, Amine Mhedhbi
Abstract
Many-to-many joins are central to analytical and semantic workloads such as fraud detection, network analysis, and recommendation, where insights arise from relationships between entities. These workloads often suffer from an explosion of intermediate results, sometimes orders of magnitude larger than the inputs. Factorized representations address this problem by exploiting conditional independence among attributes to encode intermediates more compactly. In some cases, they can reduce the output size asymptotically below the worst-case output size. However, adopting factorization in modern vectorized query processors remains challenging: factorized representations are hierarchical, whereas vectorized execution is built around flat, block-oriented processing. Prior approaches either rely on full materialization or support only restricted factorization layouts, sacrificing much of the benefits of both factorization and vectorization. We present FFX, a novel engine for Fast Factorized eXecution. FFX is the first pipelined engine to support arbitrary factorization schemes while preserving full vectorization. The engine introduces packed factorized vectors and operators that maintain cache-friendly, contiguous layouts. Beyond analytics, FFX also co-optimizes semantic operators by serializing factorized intermediates into compact prompts for large language models (LLMs), substantially reducing token usage and inference cost while maintaining output quality and, in some cases, improving it. Together, these contributions enable efficient execution of join-heavy analytical queries, including queries augmented with semantic operators.
Create a lesson
Related papers
PROBE: Learned Proxy-Based Execution for Highly Selective Multimodal Semantic Queries
Shared title terminology · Haikai Zhao, Haisheng Fu, Zhengjie Miao et al.
NousDB - A Fast Query Engine for Semantic Analytics
Shared title terminology · Christos Tsapelas, Georgia Koutrika, Yannis Ioannidis
When Plans Change Answers: Formalizing Cost-Accuracy Optimization for Semantic Queries
Shared title terminology · Kyoungmin Kim
Natural Language Knowledge Graph Query Execution: Leveraging Controlled Semantics in the LLM Context Window
Shared title terminology · Blake G. Fitch
Concord: A Video Relational Algebra for Cross-Modal Query Optimization
Shared title terminology · Sultan Muratbek, Charisse Ivana Yeung, Chanwut Kittivorawong et al.
Relational-Core Graph Analytics Querying graphs at SQL scale, and why the node/edge model is a performance tax, not a truer picture of connected data
Shared title terminology · Gene Zhang