English

Complexity of Evaluating GQL Queries

Databases 2025-10-23 v3

Abstract

GQL has recently emerged as the standard query language over graph databases (particularly, the property graph model). Indeed, this is analogous to the role of SQL for relational databases. Unlike SQL, however, fundamental problems regarding GQL are hitherto still unsolved, most notably the complexity of query evaluation. In this paper we provide a complete solution to this problem. In particular, we show that the data complexity of GQL is PNP[log]\text{P}^{\text{NP}[\log]}-complete in general, and is NL\text{NL}-complete, when the so-called ``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 (for example the domain of real numbers where arithmetic is allowed in the query). In proving these results, we establish and exploit tight connections between GQL and query languages over relational databases, especially the extension of relational calculus with transitive closure operators, and a fragment of second-order logic.

Keywords

Cite

@article{arxiv.2407.06766,
  title  = {Complexity of Evaluating GQL Queries},
  author = {Diego Figueira and Anthony W. Lin and Liat Peterfreund},
  journal= {arXiv preprint arXiv:2407.06766},
  year   = {2025}
}
R2 v1 2026-06-28T17:34:12.334Z