Testability of Homomorphism Inadmissibility: Property Testing Meets Database Theory

Hubie Chen, Yuichi YoshidaarXiv 2026

TL;DR

Imagine you have a database the size of a small planet. You want to know if a specific pattern—say, a specific chain of transactions—is absent from the data. Instead of scanning every byte, can you just "poke" the database a few dozen times and be sure? This paper proves that for the most common types of database queries, the answer is a resounding "yes," but only if the query’s structure is sufficiently "simple" (specifically, what theorists call $\alpha$-acyclic).

What Problem Does This Paper Address?

In the era of Big Data, reading an entire dataset to answer a question is often prohibitively expensive. This has led to the field of Property Testing, which asks: can we distinguish between an object that has a property and one that is "far" from having it by looking at only a tiny, random sample?

The authors bridge the gap between this field and Database Theory. Specifically, they look at "Conjunctive Queries" (the bread and butter of SQL, involving SELECT, FROM, and WHERE clauses). They want to know if we can test for Homomorphism Inadmissibility—a fancy way of saying "proving the query returns no results"—without reading the whole database.

The challenge is that for many queries, a single missing tuple can change the answer from "true" to "false." Property testing relaxes this: we want to distinguish between a database where the query is truly false and one where you’d have to delete a significant percentage of the data to make it false.

Methods

The authors introduce a new, mathematically robust way to interact with a database called the Completion Oracle.

Instead of just asking "is this specific row here?", you can provide a partial row with wildcards (e.g., "Give me a random transaction where the sender is Alice, but I don't care who the receiver is"). The oracle returns a random matching entry or tells you none exist. They also use a Size Oracle to ask how many such matches exist.

Using this model, they developed an algorithm called HI-Test. It works by trying to "build" a result for the query piece-by-piece. If it gets stuck (the oracle returns nothing), it's a sign the query might be false. If the query's structure is "acyclic" (meaning it doesn't have complex, interlocking loops), the algorithm can guarantee an answer with a constant number of pokes, regardless of how many billions of rows are in the database.

Datasets

As a theoretical "Dichotomy Theorem" paper, the authors do not use real-world datasets. Instead, they use:

  • Mathematical Reductions: They prove their limits by showing that if you could test "loopy" queries easily, you could also solve famous hard problems in graph theory (like finding triangles in a massive graph) faster than is known to be possible.
  • Synthetic Hypergraphs: For their lower-bound proofs, they construct specific distributions of random $k$-uniform hypergraphs to show exactly where the "constant-query" magic breaks down.

Key Insights and Ideas

  • The "Core" is Key: Every query has a "core"—the leanest version of itself. The authors found that the testability of a query depends entirely on the structure of this core.
  • The Acyclicity Boundary: The "Aha!" moment is that $\alpha$-acyclicity—a concept already famous in database theory for making queries run faster—is the exact same boundary that determines if a query is testable with a constant number of samples.
  • One-Sided Error: Their algorithm is "one-sided," meaning if it finds a result, it knows for sure the query is true. If it doesn't find one after a few tries, it can say with high confidence that the query is "far from true."
  • Generalizing Graphs: This work generalizes previous results from graph theory (like subgraph-freeness) into the much broader world of relational databases with multiple tables and complex relationships.

Key Results

  • The Dichotomy Theorem: A conjunctive query is constant-query testable with one-sided error if and only if its core is $\alpha$-acyclic.
  • The Penalty for Loops: If the query is not $\alpha$-acyclic (i.e., it has cycles), the number of queries required jumps from a constant (like 100) to something that grows with the database size ($n^{1/c}$), making it much less efficient for massive data.
  • Injective Testability: They also showed that "injective" versions of these problems (where every variable in your query must map to a distinct element in the database) are also constant-query testable if the query is $\alpha$-acyclic.

Limitations and Future Work

  • One-Sided vs. Two-Sided: The paper focuses on one-sided error (where the algorithm only rejects if it finds a "smoking gun"). The authors leave the characterization of two-sided error (which might allow for more complex queries) as an open question.
  • Beyond Conjunctive Queries: While conjunctive queries are common, they don't include "negation" (e.g., "Find users who have not made a purchase"). Extending this framework to more expressive logic is a clear next step.
  • Oracle Implementation: The paper treats the "Completion Oracle" as a black box. While they show it can be implemented efficiently using standard database indexes (like range trees), real-world performance on different database architectures remains to be explored.

Summary updated

Abstract

In this paper, we utilize the perspective of property testing to consider the testability of relational database queries. A primary motivation is the desire to avoid reading an entire database to decide a property thereof. We focus on conjunctive queries, which are the most basic and heavily studied database queries. Each conjunctive query can be represented as a relational structure $\mathbf{A}$ such that deciding if the conjunctive query is satisfied by a relational structure $\mathbf{B}$ is equivalent to deciding if there exists a homomorphism from $\mathbf{A}$ to $\mathbf{B}$. We phrase our results in terms of homomorphisms. Precisely, we study, for each relational structure $\mathbf{A}$, the testability of homomorphism inadmissibility from $\mathbf{A}$. We consider algorithms that have oracle access to an input relational structure $\mathbf{B}$ and that distinguish, with high probability, the case where there is no homomorphism from $\mathbf{A}$ to $\mathbf{B}$, from the case where one needs to remove a constant fraction of tuples from $\mathbf{B}$ in order to suppress all such homomorphisms. We provide a complete characterization of the structures $\mathbf{A}$ from which one can test homomorphism inadmissibility with one-sided error by making a constant number of queries to $\mathbf{B}$. Our characterization shows that homomorphism inadmissibility from $\mathbf{A}$ is constant-query testable with one-sided error if and only if the core of $\mathbf{A}$ is $α$-acyclic. We also show that the injective version of the problem is constant-query testable with one-sided error if $\mathbf{A}$ is $α$-acyclic; this result generalizes existing results for testing subgraph-freeness in the general graph model.
BibTeX
@misc{chen2026testability,
  author = {Hubie Chen and Yuichi Yoshida},
  title = {{Testability of Homomorphism Inadmissibility: Property Testing Meets Database Theory}},
  year = {2026},
  eprint = {2611.26861},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.26861},
}
Figure