Tailwind: A Practical Framework for Query Accelerators

Geoffrey X. Yu, Ryan Marcus, Tim KraskaarXiv 2026

TL;DR

Tailwind is a non-invasive query planning framework that transparently injects highly specialized "query accelerators" into any relational database (RDBMS) without modifying its source code. By introducing a declarative abstraction called Abstract Logical Plans (ALPs) paired with tree-structured neural networks, Tailwind accurately predicts when a specialized accelerator will outperform the base database, delivering significant speedups on systems like Amazon Redshift and DuckDB.

What Problem Does This Paper Address?

General-purpose relational database management systems (RDBMSes) are designed to handle any arbitrary query, but this generality often leaves massive performance gains on the table. For specific workloads, purpose-built algorithms or precomputed data structures (which the authors call query accelerators) can execute sub-plans orders of magnitude faster than a standard database engine.

However, integrating these accelerators into an existing RDBMS is an engineering nightmare. It requires deep, invasive changes across the query optimizer, cost model, and execution engine. This "blast radius" makes custom optimizations impractical to maintain in open-source databases (like DuckDB) and completely impossible in closed-source, proprietary cloud data warehouses (like Amazon Redshift).

The authors introduce Tailwind to bridge this gap, allowing developers to plug specialized query accelerators into any RDBMS cleanly from the outside.

Figure 2: An overview of the Tailwind system and its workflow.

Methods

Tailwind operates as a database proxy layer sitting on top of an RDBMS. Its architecture relies on several novel components:

  • Abstract Logical Plans (ALPs): A new declarative abstraction based on parameterized regular tree expressions. Instead of writing complex imperative code to check if an accelerator can handle a query, builders define the "shape" of supported logical sub-plans using an ALP template.
  • Tree-Structured Neural Networks: Tailwind automatically compiles the tree structure of an ALP into a custom neural network architecture. This model learns to predict the accelerator's runtime based on query features (such as estimated cardinality and predicate selectivity) without needing to inspect or understand the accelerator's internal code.
  • E-Graphs and Equality Saturation: To robustly match ALPs against incoming queries, Tailwind converts query plans into e-graphs. This allows Tailwind to identify acceleration opportunities even if the underlying database optimizer has reordered filters or joins.
  • Two-Phase Planning:
    • Offline: Tailwind uses a greedy search to select which stateful accelerator instances to precompute and store based on a user-defined space budget.
  • Online: When a query arrives, Tailwind intercepts it, identifies matching sub-plans, uses its performance models to verify if the accelerator will actually provide a benefit, and transparently rewrites the query.

Datasets

The authors evaluated Tailwind using three distinct workloads:

  1. TPC-H (Scale Factor 100): A standard industry benchmark for analytical queries representing 100 GB of data.
  2. TPC-H-Plus: A newly introduced benchmark variant created by the authors. It merges fragments of standard TPC-H queries into 20 complex templates to create opportunities for multiple accelerators to trigger within a single query.
  3. SQLStorm Stack Overflow: A real-world dataset consisting of 240 GB of data from the Stack Overflow website, evaluated using a subset of 356 diverse queries.

Key Insights and Ideas

  • Structure Provides Inductive Bias: Forcing accelerator builders to declare applicability via ALPs rather than arbitrary code provides a major machine learning advantage. The tree structure of the ALP maps perfectly to a tree-structured neural network, providing the ideal inductive bias to predict performance accurately with minimal training data (~10k samples).
  • Cost Modeling is Mandatory: A naive strategy that blindly applies accelerators whenever they match often destroys performance. Hidden costs—such as cloud data transfer overheads or executing a "negated" query when the original predicate was already highly selective—can cause massive regressions. A precise cost model is essential to know when not to accelerate.
  • RDBMS-Aware Tailoring: Tailwind automatically tailors its choices to the host database. For instance, it might leverage an index accelerator frequently on DuckDB (where in-process data transfer is practically free) but reject the exact same accelerator on Redshift because the network cost of moving intermediate tuples out of the cloud warehouse outweighs the execution speedup.

Key Results

Tailwind was evaluated using four baseline accelerators (Domain Negation, Cumulative Filtered Aggregates, Known Group-By, and Ordered Indexes) alongside two workload-specific ones (Top-k Pushdown and Badges Materialized Views).

  • TPC-H: Tailwind achieved geomean speedups of 1.32× on Redshift and 1.38× on DuckDB.
  • TPC-H-Plus: Tailwind delivered geomean speedups of 1.37× on Redshift and 1.76× on DuckDB. For complex queries where multiple accelerators were safely combined, it achieved localized speedups up to 4.6×–5.6×.
  • SQLStorm: On real-world data, Tailwind yielded geomean speedups of 1.28× (Redshift) and 1.27× (DuckDB), primarily driven by pushing down top-k operations.
Figure 6: Tailwind accelerates TPC-H-Plus on Redshift and DuckDB by 1.37× and 1.76× respectively (geomean).

Limitations and Future Work

  • Bulk-Write Dependency: Tailwind targets OLAP (analytical) environments characterized by bulk writes. Because accelerators rely on precomputed state, any data modification renders them stale. Tailwind currently routes queries back to the base RDBMS while rebuilding accelerators in the background. Implementing incremental state maintenance is left for future work.
  • Upstream Predictor Errors: Tailwind's cost model relies on the host database's cardinality estimates. While the framework is robust up to a Q-error of 3.0, severe mispredictions by the underlying RDBMS can still lead Tailwind to make suboptimal routing choices.
  • Synthesis Automation: While Tailwind automates the planning, matching, and cost-modeling of accelerators, humans must still write the accelerator code. The authors note that combining Tailwind with LLM-based query engine generators could eventually allow for entirely automated, end-to-end synthesis of custom database extensions.

Summary updated

Abstract

Relational database management systems (RDBMSes) can process general-purpose queries, but often have lower performance compared to custom-built solutions for specific queries. For example, consider a group-by query over a few known groups (e.g., grouping by country). While an RDBMS would likely use a hash map to do the grouping, a faster method could hard-code the expected groups into the query executor. Such workload-specific techniques, which we call query accelerators, are not widely used in practice because the engineering effort (optimizer and engine changes, potential bugs) does not always justify the isolated performance gains (speedup on a specific query). We propose Tailwind: a non-invasive query planner that brings accelerators into any RDBMS that supports data import/export. Accelerator builders register accelerators using abstract logical plans (ALPs): a new abstraction based on regular tree expressions that specifies the logical sub-plans each accelerator can correctly replace. Tailwind also uses each ALP's structure to automatically build a neural network model to predict the accelerator's performance. At runtime, Tailwind sits atop an RDBMS and transparently rewrites queries to run across one or more accelerators when predicted to be beneficial, falling back to the underlying RDBMS when not. Across three distinct case studies, we use Tailwind to integrate workload-specific accelerators with Redshift and DuckDB to achieve geomean speedups of 1.38x, 1.76x, and 1.28x.
BibTeX
@misc{yu2026tailwind,
  author = {Geoffrey X. Yu and Ryan Marcus and Tim Kraska},
  title = {{Tailwind: A Practical Framework for Query Accelerators}},
  year = {2026},
  eprint = {2604.28079},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2604.28079},
}

Loading related content...

Figure