,
Anthony W. Lin
,
Liat Peterfreund
Creative Commons Attribution 4.0 International license
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.
@InProceedings{figueira_et_al:LIPIcs.ICDT.2026.13,
author = {Figueira, Diego and Lin, Anthony W. and Peterfreund, Liat},
title = {{Complexity of Evaluating GQL Queries}},
booktitle = {29th International Conference on Database Theory (ICDT 2026)},
pages = {13:1--13:18},
series = {Leibniz International Proceedings in Informatics (LIPIcs)},
ISBN = {978-3-95977-413-0},
ISSN = {1868-8969},
year = {2026},
volume = {365},
editor = {ten Cate, Balder and Funk, Maurice},
publisher = {Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik},
address = {Dagstuhl, Germany},
URL = {https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.ICDT.2026.13},
URN = {urn:nbn:de:0030-drops-256278},
doi = {10.4230/LIPIcs.ICDT.2026.13},
annote = {Keywords: Graph query languages, GQL, complexity, database theory}
}