Answering Graph Pattern Queries using Compact Materialized Views

Michael Lan, Xiaoying Wu, Dimitri TheodoratosDOLAP 2022

Introduction

Graph pattern matching—the process of identifying specific structural subgraphs within a larger network—is a cornerstone of modern data analysis, spanning domains from social network mining to bioinformatics. However, this task becomes computationally prohibitive when dealing with hybrid queries. These queries involve both direct parent-child relationships (child edges) and reachability relationships over an arbitrary number of steps (descendant edges).

The primary challenge in hybrid query processing is the "intermediate result explosion." Traditional methods often rely on reachability indices, which generate a massive number of candidate matches that must be filtered and joined. While materialized views (pre-computing results) are a standard optimization in relational databases, they are difficult to apply to graphs because the number of individual matches can be astronomically large, making them too bulky to store or join efficiently. This paper introduces MatView, a framework that utilizes "summary graphs" as compact materialized views to bypass these bottlenecks.

Methodology: The MatView Framework

MatView shifts the paradigm from storing individual match tuples to materializing the search space itself. This is achieved through three core technical pillars:

1. Summary Graphs as Materialized Views

Instead of a flat list of results, MatView represents matches as a summary graph. This is a compact, $k$-partite graph where each partition corresponds to a node in the query pattern, and edges represent valid relationships in the data graph. This structure encodes all possible homomorphisms (matches) of the view to the data graph without explicitly enumerating them.

Figure 3: Comparison of data graph G, query Q, traditional match table (c), and the proposed summary graph GQ (d).

As shown in the figure above, while a traditional table (c) might require many rows to represent matches, the summary graph (d) provides a compressed representation that is far more efficient to store and manipulate.

2. View Usability and Coverage

A critical aspect of the framework is determining when a materialized view can help answer a new query. The authors define a formal condition for "view usability": a view is usable if its edges "cover" the query's edges. This coverage is determined by checking for homomorphisms between the view and the query itself. By identifying which parts of a query are already pre-computed in existing views, the system can avoid redundant computations.

Figure 6: Illustration of a query Q and its coverage by various materialized views V1 through V4.

3. The SumGraphBuild Algorithm and Minimal Selection

To answer a query, the SumGraphBuild algorithm "intersects" the relevant materialized summary graphs. It uses bitwise AND operations on bitmaps representing node sets to prune candidates that cannot be part of a final match. This bitwise approach leverages modern CPU optimizations for extreme speed. Furthermore, because using too many views can introduce overhead, MatView includes an algorithm to select the minimal set of views necessary to cover all non-redundant edges of the query.

Experimental Evaluation

The researchers evaluated MatView against FltSim, a state-of-the-art graph matching algorithm that does not utilize materialized views, using two real-world datasets:

  • BerkStan (bs): A web graph (~685k nodes, ~402k edges) with high node connectivity.
  • DBLP (db): A computer science bibliography network (~317k nodes, ~1.05M edges).

Key Results

  • Performance: MatView consistently outperformed FltSim by 3 to 5 orders of magnitude. The performance gap was most pronounced in complex queries with numerous descendant edges, where traditional reachability index lookups become a major bottleneck.
  • Scalability: While FltSim's execution time grew steeply with data graph size, MatView demonstrated superior scalability, with execution times increasing much more gradually.
  • Efficiency of Minimalism: The experiments confirmed that a minimal set of views is sufficient; adding redundant views provided negligible gains while increasing the complexity of the view selection process.

Discussion and Future Work

MatView demonstrates that compactness is essential for effective graph view materialization. By focusing on the search space rather than the result set, the framework avoids the explosion of intermediate results. Furthermore, by embedding reachability information directly into the views, it bypasses expensive index lookups during query time.

Despite its success, the current framework has limitations. It focuses on query answering using static views and does not yet address view maintenance in dynamic graphs where edges are frequently added or removed. Future work aims to develop scale-independent answering techniques that could potentially resolve queries using only the summary graphs, without ever accessing the underlying base data graph.

Summary updated

BibTeX
@inproceedings{lan2022answering,
  author = {Michael Lan and Xiaoying Wu and Dimitri Theodoratos},
  title = {{Answering Graph Pattern Queries using Compact Materialized Views}},
  booktitle = {DOLAP},
  year = {2022},
}
Figure