Schema-Based Query Optimisation for Graph Databases
Chandan Sharma, Pierre Genevès, Nils Gesbert, Nabil Layaïda
TL;DR
The paper addresses the high cost of evaluating recursive graph queries by leveraging graph schema information. It introduces a schema-based type inference that enriches queries with node-label constraints, producing schema-aware UCQT rewritings that preserve semantics via proven soundness and completeness. A practical prototype translates these rewritings into graph patterns and recursive relational algebra, and extensive experiments on YAGO and LDBC-SNB demonstrate substantial performance gains for recursive queries, including eliminations of costly transitive closures and reductions in intermediate results. The results validate the approach across graph and relational backends, showing opportunistic enrichment that only activates when performance benefits are expected, with clear practical implications for scalable graph analytics.
Abstract
Recursive graph queries are increasingly popular for extracting information from interconnected data found in various domains such as social networks, life sciences, and business analytics. Graph data often come with schema information that describe how nodes and edges are organized. We propose a type inference mechanism that enriches recursive graph queries with relevant structural information contained in a graph schema. We show that this schema information can be useful in order to improve the performance when evaluating acylic recursive graph queries. Furthermore, we prove that the proposed method is sound and complete, ensuring that the semantics of the query is preserved during the schema-enrichment process.
