arXiv:2610.22673cs.DBOct 2026

Manuscript Offprint

arXiv:2610.22673

The Case for TPU-Accelerated Analytical Query Processing

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

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Large-scale analytical query processing requires computing substrates capable of immense distributed scale-out. Tensor Processing Units (TPUs) perfectly embody this extreme-scale architecture, offering massive computational density and highly scalable optical pod-level interconnects. Despite these advantages, TPUs have so far remained largely unexplored for analytical database workloads. In this paper, we present the first comprehensive case for TPU-accelerated analytical query processing by running all the TPC-H queries entirely on the TPUs. We introduce Native TPU Accelerator (NTA) for analytical query processing, which provides hardware-conscious algorithm design and optimizations in JAX/XLA. By exposing the TPU's structural mechanics, we demonstrate how dynamic, memory-bound database operations can be rewritten into deterministic JAX programs. We engineer a suite of novel execution strategies that leverage both the TPU's TensorCore and SparseCore to trade sparse, unpredictable memory accesses for dense, hardware-aligned ones. At the core of NTA, a compiler uses catalog statistics to assign guarded static capacities and a hardware-calibrated local cost model to select a TPU-native implementation for each relational operator before JIT compilation.

We evaluate our system using the TPC-H benchmark. Taking full advantage of TPU slices and JAX distributed computing, we seamlessly scale our execution environment to run TPC-H benchmark up to Scale Factor 1000 (SF1000). Evaluated against a rigorous CPU ground truth (DuckDB), our native TPU accelerator achieves state-of-the-art performance, achieving a 7.0×7.0\times single-device speedup over DuckDB at SF100 and a 68.6×68.6\times speedup with 16 TPUs at SF1000 (1TB). The results establish TPUs not merely as dense neural compute hardware, but as a highly competitive, massively scalable substrate for the next generation of analytical query processing.

PVLDB Reference Format:

Jaehyun Ha, Yeounoh Chung ∗^{*}, Helena Caminal, Aditya K Kamath, Fatma Özcan, Arvind Krishnamurthy, Henry M. Levy. The Case for TPU-Accelerated Analytical Query Processing. PVLDB, 20(1): XXX-XXX, 2027.

doi:XX.XX/XXX.XX

1 INTRODUCTION

Hardware-accelerated query processing is gaining significant momentum across both academic and commercial analytics systems [3, 14, 17, 25, 37], which require computing substrates capable of immense, distributed scale-out. Tensor Processing Units (TPUs) perfectly embody this capability: powering massively large-scale search and AI/ML workloads, they offer extreme computational density and highly scalable optical pod-level 1^{1} interconnects [19]. Despite these massive structural advantages, TPUs remain largely unexplored for analytical database systems. This paper fundamentally explores running relational queries on TPU architectures, revealing precisely what it takes to map analytical queries to what is conventionally assumed to be a static execution paradigm built explicitly without hardware-managed caches or dynamic execution.

TPU and especially its main compute units, TensorCores, require a fixed and deterministic execution environment where memory access and shapes must be compiled and pre-determined. In contrast, relational operators rely on data-dependent dynamism [26], which is hard to predict. The number of rows produced by a filter (shape dynamism) and the memory locations where matching tuples reside in a join (address dynamism) are strictly runtime properties determined by the data. The TPU TensorCore, however, enforces completely static evaluation: every instruction, buffer size, and DMA transfer must be predictably scheduled at query compile time. Naively mapping relational operations onto such a static substrate creates immense sparsity out of forced worst-case padding, and HBM pipeline stalls resulting from irregular gather/scatter 2^{2}. Traditional CPUs and GPUs mask these erratic access patterns dynamically using large, hardware-managed caches and massive multithreading architectures [21]. Fortunately, modern TPUs added SparseCore units to accelerate sparse, non-uniform memory accesses that can run in parallel with TensorCore computations.

In this work, we argue that TPUs can be used as efficient processors for analytical workloads by fundamentally neutralizing dynamic memory accesses, using a new TPU hardware co-processor, SparseCore [18]. We introduce Native TPU Accelerator (NTA), a tensor-based execution engine built entirely in JAX and XLA [2] 3^{3}. Rather than treating the TPU as a black-box HW accelerator, NTA co-designs relational operators directly around its memory and compute hierarchy. Our core insight is that dynamic, memory-bound database operations can be meticulously rewritten into predictable,

This work is licensed under the Creative Commons BY-NC-ND 4.0 International License. Visit https://creativecommons.org/licenses/by-nc-nd/4.0/ to view a copy of this license. For any use beyond those covered by this license, obtain permission by emailing info@vldb.org. Copyright is held by the owner/author(s). Publication rights licensed to the VLDB Endowment.

Proceedings of the VLDB Endowment, Vol. 20, No. 1 ISSN 2150-8097. doi:XX.XX/XXX.XX

1^{1}A TPU Pod is a cluster of Google Tensor Processing Units (TPUs) connected by a high-speed network to act as a single, powerful AI supercomputer.

2^{2}Gather refers to indirect, non-contiguous reads (e.g., retrieving join matches via index vectors); scatter refers to indirect writes or in-place accumulations at arbitrary addresses (e.g., updating hash buckets or histogram bins).

3^{3}JAX is an ML framework that represents array operations as tensor computation graphs; XLA (Accelerated Linear Algebra) is an ML compiler that lowers these computation graphs into statically scheduled, fused executables on HW accelerators.

∗^{*}Corresponding author.

compute-bound arithmetic. For instance, SORTED-HASH LOOKUP JOIN avoids sparse, padded hash tables, using unique-build equijoints by sorting hashed composite keys and validating each retrieved candidate against the original packed key.

Providing highly optimized kernels is insufficient unless a dynamic relational plan can be converted into a well-orchestrated TPU program. To achieve this, NTA introduces an end-to-end query compilation and execution pipeline (Section 3). Given an incoming logical plan, NTA uses catalog statistics to assign guarded capacities (bounded static shapes) to intermediate results, derives existing logical and physical properties, and selects a cost-optimal execution target (TensorCore vs. SparseCore) kernel implementation for each operator. NTA then stitches individual physical operators into a physical plan, which is then lowered (program transformation) into a statically shaped JAX program with Pallas kernels 4{}^{4}. Finally the JAX program is compiled and further optimized using the XLA compiler.

To evaluate NTA at large scales (up to SF1000), we leverage JAX distributed (XLA SPMD [34]) computing over TPU v5p [11] slices. For a rigorous baseline, we compare our performance against DuckDB, a state-of-the-art SIMD-vectorized in-memory CPU database engine [13, 14, 17]. NTA achieves state-of-the-art performance, outperforming DuckDB on all 22 TPC-H queries and achieving geometric-mean speedups of 7.0×7.0\times at SF100 (100GB) and 68.6×68.6\times at SF1000 (1TB). When measured by total query-set runtime, the corresponding total-runtime speedups are 5.7×5.7\times and 50.1×50.1\times over the CPU baseline.

In summary, this paper makes the following contributions:

• The case for TPU-Accelerated Analytical Query Processing: We present the first deep architectural analysis of mapping relational algebra onto TPU semantics, explicitly identifying core anti-patterns (shape dynamism, sparsity, gather/scatter stalls) and standardizing their mitigation.

• Native TPU Kernels via Pallas & SparseCore: We introduce a suite of highly optimized, TPU-native execution strategies, designed to address gather/scatter bottlenecks and HBM anti-patterns (round-trips and fusion breaks).

• Compilation and Local Physical Planning: Given a fixed logical plan, NTA bounds intermediate cardinalities, filters physical implementations by applicability and resource constraints, and selects among them using TPU v5p-calibrated operator costs before JIT compilation.

• Comprehensive Evaluation at Extreme Scale: We demonstrate state-of-the-art analytical performance on TPC-H, utilizing JAX distributed computing to scale smoothly to SF1000 across orchestrated TPU slices.

The remainder of this paper is organized as follows: Section 2 provides the architectural background on TPU and highlights our motivating micro-benchmarks. Section 3 details our native TPU-accelerated query processing algorithms. Section 4 describes our compiler and hardware-conscious intelligent kernel selection. Section 5 details extreme scale orchestration. Section 6 presents our extensive experimental evaluation. Finally, Sections 7 and 8 offer discussion and conclusions.

Figure

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

References (9)