The Case for TPU-Accelerated Analytical Query Processing

Yeounoh Chung, Jaehyun Ha, Helena Caminal, Fatma Ozcan, Aditya K Kamath, Arvind Krishnamurthy, Henry M. LevyarXiv 2026

Google’s Tensor Processing Units (TPUs) are the undisputed heavyweights of the AI world, but can they handle a "boring" SQL join? Traditionally, the answer was a resounding "no" due to the fundamental mismatch between the static nature of TPU execution and the dynamic nature of relational algebra.

In their recent paper, "The Case for TPU-Accelerated Analytical Query Processing," researchers from Google and the University of Washington present Native TPU Accelerator (NTA), the first system to prove that TPUs aren't just for neural networks—they are a massively scalable substrate for the next generation of analytical databases.

TL;DR

NTA is the first comprehensive execution engine to run full analytical benchmarks (TPC-H) entirely on TPUs. By co-designing relational operators for the TPU’s unique memory hierarchy and leveraging the SparseCore co-processor, NTA achieves up to a 68.6x speedup over state-of-the-art CPU engines (DuckDB) at terabyte scale.

What Problem Does This Paper Address?

The core challenge is a "Taxonomy of Dynamism." Analytical queries are inherently dynamic:

  1. Shape Dynamism: You don't know how many rows a FILTER will produce until you run it.
  2. Address Dynamism: In a JOIN, the memory locations of matching tuples depend on the data values.

TPUs, however, are built for deterministic simplicity. They lack hardware-managed caches and branch predictors. Instead, they rely on a compiler (XLA) to pre-schedule every memory transfer and buffer size. Naively porting SQL to this environment leads to "fusion breaks"—where the computation pipeline stalls because it hits a data-dependent memory access—forcing expensive round-trips to main memory (HBM).

Figure 1: TPU TensorCore and SparseCore HW overview and memory hierarchy [18].

Methods

NTA bridges this gap by meticulously rewriting dynamic database operations into predictable tensor arithmetic using JAX and Pallas.

  • Static Shape Planning: Instead of dynamic allocation, NTA uses database catalog statistics to calculate "guarded" static bounds for every intermediate result. If a query exceeds these bounds, it triggers a re-compile with a larger safety margin.
  • Intelligent Kernel Selection: NTA doesn't just use one "Join" algorithm. It features a catalog of TPU-native implementations. A cost model selects the best one based on data properties (e.g., using the MXU for dense aggregations vs. the SparseCore for irregular lookups).
  • Leveraging the SparseCore: Modern TPUs include a SparseCore designed for embedding lookups. NTA repurposes this hardware to handle the "gather/scatter" operations essential for joins and aggregations, effectively neutralizing address dynamism.
  • Distributed Scaling: Using JAX’s GSPMD partitioner, NTA co-shards data across TPU pods, keeping most operations local to the device and minimizing interconnect bottlenecks.
Figure 3: NTA Architecture and End-to-End Query Lifecycle. (1) Static shape planning assigns guarded buffer bounds; (2) Phys- ical implementation selection maps operators to VPU, MXU, or SparseCore; (3) Plan lowering emits a JAX/Pallas program compiled by XLA SPMD; (4) Distributed execution evaluates queries over co-partitioned shards across the TPU slice.

Datasets

The authors evaluated NTA using two primary benchmarks:

  • TPC-H: The industry standard for analytical queries, tested at Scale Factors 1 (1GB), 100 (100GB), and 1000 (1TB).
  • ClickBench: A 100M-row flat-table benchmark representing real-world "wide table" analytics.

Key Insights and Ideas

  • Neutralizing Dynamism: The "aha" moment is that relational operators can be transformed into hardware-aligned tensor math. For example, a join can be rewritten as a Sorted-Hash Lookup, turning a random-access nightmare into a vectorized binary search.
  • Fusion is King: On TPUs, the cost of a "fusion break" (going back to HBM) is catastrophic. NTA’s primary goal is to keep data streaming through fast on-chip memory (VMEM) by fusing filters and projections directly into the join/agg kernels.
  • The SparseCore is the Secret Sauce: While the TensorCore (MXU) provides massive throughput for dense math, the SparseCore is what makes relational algebra viable on TPUs by handling irregular memory access patterns that would otherwise stall the pipeline.
Figure 4: Physical operator selection for joins and grouped aggregations. Blue rightward branches denote satisfied conditions; gray downward branches continue to the next alternative. Conditions and leaves correspond to Table 3.

Key Results

NTA was compared against DuckDB, a state-of-the-art SIMD-vectorized CPU engine.

  • Single-Device Performance: At SF100, NTA achieved a 7.0x geometric mean speedup over DuckDB.
  • Extreme Scale: On a 16-TPU v5p cluster at SF1000 (1TB), NTA achieved a 68.6x speedup. The entire TPC-H suite finished in just 1.6 seconds.
  • Near-Linear Scaling: NTA demonstrated near-linear distributed speedup when scaling from 1 to 128 TPU chips, proving the effectiveness of its row-wise co-sharding strategy.

Limitations and Future Work

  • Variable String Lengths: Current static padding for strings leads to significant memory and bandwidth waste. The authors identify this as a prime candidate for future hardware-software co-design.
  • Multi-tenancy: TPUs currently lack hardware-level virtual partitioning, meaning concurrent queries must be serialized in a FIFO queue.
  • Semantic Queries: The authors see a major opportunity in "Semantic AI" queries—unifying relational SQL and LLM inference into a single JAX program that runs entirely on the TPU, eliminating the host-to-accelerator bottleneck.

Summary updated

BibTeX
@misc{chung2026case,
  author = {Yeounoh Chung and Jaehyun Ha and Helena Caminal and Fatma Ozcan and Aditya K Kamath and Arvind Krishnamurthy and Henry M. Levy},
  title = {{The Case for TPU-Accelerated Analytical Query Processing}},
  year = {2026},
  eprint = {2610.22673},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.22673},
}
Figure