Modern graph database query languages such as GQL, SQL/PGQ, and their academic predecessor G-Core promote paths to first-class citizens in the sense that paths that match regular path queries can be returned to the user. This brings a number of challenges in terms of efficiency, caused by the fact that graphs can have a huge amount of paths between a given node pair. We introduce the concept of path multiset representations (PMRs), which can represent multisets of paths in an exponentially succinct manner. After exploring fundamental problems such as minimization and equivalence testing of PMRs, we explore how their use can lead to significant time and space savings when executing query plans. We show that, from a computational complexity point of view, PMRs seem especially well-suited for representing results of regular path queries and extensions thereof involving counting, random sampling, unions, and joins.
翻译:GQL、SQL/PGQQ、SQL/PGQ等现代图形数据库查询语言及其学术前任G-Core推动一流公民的路径,其含义是,与常规路径查询相匹配的路径可以归还给用户。这在效率方面带来了一些挑战,因为图形可以在给定节点配对之间拥有大量路径。我们引入了路径多位表示的概念,它能够以惊人的简洁方式代表路径的多组。在探索了像最小化和等值测试PMR等值等基本问题之后,我们探索了这些路径的使用如何在执行查询计划时导致大量时间和空间的节约。我们从计算的复杂性角度表明,PMR似乎特别适合代表常规路径询问的结果,以及包括计数、随机抽样、交界和联队的延伸。