Skip to main content
QUICK REVIEW

[Paper Review] Complexity of Evaluating GQL Queries

Diego Figueira, Anthony W. Lin|arXiv (Cornell University)|Jul 9, 2024
Data Mining Algorithms and ApplicationsComputer Science1 citations
TL;DR

This paper establishes the precise data complexity of GQL, the standard query language for property graph databases. It proves that general GQL evaluation is PNP[log]-complete, while the restrictor-free fragment is NL-complete, using embeddings into second-order logic and embedded finite model theory to unify and extend results from relational query complexity.

ABSTRACT

GQL has recently emerged as the standard query language over graph databases, particularly, property graphs. Indeed, this is analogous to the role of SQL for relational databases. Unlike SQL, however, fundamental problems regarding GQL are still unsolved, most notably the complexity of query evaluation. In this paper we provide a complete solution to this problem for the core fragment of GQL and for its extension with path restrictors. In particular, we show that the data complexity of these fragments is P^NP[log]-complete in general, and drops to NL-complete when restrictors are disallowed. Using techniques from embedded finite model theory, we show that this is true, even when the queries use data from infinite concrete domains such as real numbers with arithmetic. In proving these results, we establish and exploit tight connections between GQL and query languages over relational databases, especially extensions of relational calculus with transitive closure operators and fragments of second-order logic.

Motivation & Objective

  • To determine the exact data complexity of GQL, the standard query language for property graphs.
  • To close a fundamental gap in the theoretical understanding of GQL, analogous to the well-mapped complexity of SQL.
  • To extend complexity results to infinite domains, such as real numbers with arithmetic, while preserving complexity bounds.
  • To establish connections between GQL and relational query languages, particularly those with transitive closure and second-order logic.
  • To demonstrate that logical embeddings can unify and simplify complexity analysis across graph and relational query models.

Proposed method

  • Embedding GQL into fragments of second-order logic and relational calculus with transitive closure to analyze complexity.
  • Using techniques from embedded finite model theory to preserve data complexity when extending to infinite domains.
  • Proving tight complexity bounds by reducing GQL queries to known logical fragments and vice versa.
  • Analyzing the impact of restrictors—GQL constructs that increase complexity—by showing their removal reduces complexity to NL.
  • Leveraging known complexity results from relational databases to infer bounds for GQL via logical equivalence.
  • Demonstrating that even with arithmetic over real numbers, the complexity remains within PNP[log] or NL, depending on restrictor use.

Experimental results

Research questions

  • RQ1What is the data complexity of evaluating GQL queries over property graphs?
  • RQ2How does the presence of restrictors affect the complexity of GQL evaluation?
  • RQ3Can complexity results for GQL be extended to infinite data domains, such as real numbers with arithmetic?
  • RQ4What logical fragments correspond to GQL, and how do they relate to relational query languages with transitive closure?
  • RQ5To what extent can logical embeddings simplify the analysis of graph query complexity?

Key findings

  • The data complexity of general GQL evaluation is PNP[log]-complete, establishing a tight upper and lower bound.
  • When restrictors are disallowed, the data complexity of GQL drops to NL-complete, matching the complexity of standard path queries in relational databases.
  • The results hold even when queries involve arithmetic over infinite domains, such as real numbers, preserving the same complexity classes.
  • The paper establishes a tight logical correspondence between GQL and fragments of second-order logic and transitive closure extensions of relational calculus.
  • The use of embedded finite model theory enables a uniform treatment of complexity across relational and graph query languages, including infinite domains.
  • The logical embedding framework allows for meta-querying capabilities—such as schema checks and property comparisons—beyond native GQL expressiveness, while preserving complexity bounds.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.