Exponential Lower Bounds and Separation for Query Rewriting

Stanislav Kikot, Roman Kontchakov, Vladimir V. Podolskii, Michael Zakharyaschev

Abstract

In Ontology-Based Data Access (OBDA), query rewriting is a critical process that translates high-level ontology queries into database-executable formats. This paper establishes fundamental theoretical limits on the size of these rewritings for the OWL 2 QL profile. By establishing a novel connection between description logics and Boolean circuit complexity, the authors prove that "pure" rewritings—those restricted to the original query vocabulary—can suffer from an unavoidable exponential blow-up. Conversely, the study demonstrates that the inclusion of extra constants and equality predicates allows for polynomial-sized rewritings, revealing a significant succinctness gap between different rewriting methodologies.

Introduction

Ontology-Based Data Access (OBDA) provides a framework for querying heterogeneous data sources through a conceptual lens provided by an ontology. To execute these queries using standard relational database management systems, the system must perform query rewriting. This process compiles the user's query and the ontology's logical constraints into a single query—typically in First-Order (FO) logic or Datalog—that can be executed directly by the database engine.

A persistent challenge in OBDA is the size of the resulting rewritten query. In practice, these rewritings can become so large that they exceed the parsing and optimization limits of modern databases. While researchers have long observed this "blow-up" phenomenon, this paper provides the first formal mathematical proofs regarding the worst-case size of rewritings for OWL 2 QL, a standard optimized for query efficiency.

Methodology: The Circuit Complexity Bridge

The authors derive their results by constructing a theoretical "bridge" between query rewriting and Boolean circuit complexity. This approach involves a multi-step reduction technique:

  1. Encoding Functions as Queries: The researchers demonstrate how to construct specific OWL 2 QL ontologies and queries such that the process of answering the query is computationally equivalent to evaluating a monotone Boolean function (e.g., determining if a graph contains a $k$-clique).
  2. Mapping Rewritings to Circuits: They prove a fundamental correspondence: if a small "pure" rewriting (using only symbols from the original query) exists for a given ontology and query, then a correspondingly small Boolean circuit or formula must also exist for the associated Boolean function.
  3. Applying Established Lower Bounds: By leveraging landmark results in theoretical computer science—such as Alexander Razborov’s lower bounds for the Clique problem—the authors prove that small rewritings are mathematically impossible for certain classes of queries.

To prove these bounds, the paper utilizes mathematical "gadgets" based on well-known hard problems in complexity theory, including CLIQUE (finding complete subgraphs), MATCHING (finding perfect matchings in bipartite graphs), and GEN (a monotone function used to distinguish between different circuit classes).

Key Insights and Results

The "Pure" vs. "Impure" Divide

The most significant finding is the distinction between "pure" and "impure" rewritings. The authors prove that "pure" rewritings, which are restricted to the original vocabulary of the query and ontology, are doomed to exponential size in the worst case. Specifically, they demonstrate cases where rewritings must be at least size $2^{\Omega(n^{1/4})}$.

However, the paper reveals a surprising solution: by allowing "impure" rewritings—which can utilize just two additional constants (such as 0 and 1) and the equality predicate (=)—it is always possible to produce a polynomial-sized rewriting. This proves that the addition of minimal extra logical machinery can prevent the exponential explosion of query size.

The Succinctness Hierarchy

The research establishes a clear hierarchy regarding the relative "compression" or succinctness of different rewriting languages:

  • Nonrecursive Datalog (NDL) can be exponentially more succinct than Positive Existential (PE) rewritings.
  • First-Order (FO) rewritings can be superpolynomially more succinct than PE rewritings.
  • The use of the GEN function specifically separates these classes, as it has small circuits but requires massive formulas.

Discussion and Limitations

While these results provide a rigorous foundation for understanding query blow-up, the authors note several nuances. The ontologies and queries used to prove these lower bounds are "artificial" and highly complex; real-world ontologies often possess simpler structures that may not trigger such extreme exponential growth.

Furthermore, the paper leaves open the question of uniformity. While the lower bounds were proved for specific sequences of query-ontology pairs, it remains to be seen if a single "hard" ontology exists that causes blow-up for all queries. Finally, while both FO and NDL were shown to be more succinct than PE, the precise relationship between the sizes of FO and NDL rewritings remains an area for future investigation.

Conclusion

This work demonstrates that query rewriting is not merely a database engineering problem but is deeply intertwined with fundamental questions in Boolean logic and computation. By proving that exponential blow-up is a mathematical reality for pure rewritings, the paper highlights the necessity of using constants and equality in OBDA systems to ensure scalable and efficient query answering.

Summary updated

BibTeX
@inproceedings{kikot2012exponential,
  author = {Stanislav Kikot and Roman Kontchakov and Vladimir V. Podolskii and Michael Zakharyaschev},
  title = {{Exponential Lower Bounds and Separation for Query Rewriting}},
  booktitle = {ICALP},
  year = {2012},
  doi = {10.1007/978-3-642-31585-5\_26},
}
Figure