Graph Query Path Filtering via Node Set Matching
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Graph database queries with filtering conditions involving path patterns suffer from low efficiency due to the need to traverse paths, which consumes significant computing resources and time, especially with longer path patterns and multiple node hops.
Innovation Solution
The method converts path pattern filtering into node set matching by first identifying nodes that meet a matching condition and then determining if they belong to a pre-identified node set, optimizing the query process to reduce traversal and improve efficiency.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If path traversal is performed to filter nodes based on path pattern, then filtering accuracy is improved, but query efficiency deteriorates
Solution Approach 1:
The patent pre-calculates and stores path patterns in a specialized data structure (path pattern index) before queries are executed. When a query arrives, the system retrieves pre-computed path patterns rather than traversing paths in real-time, significantly improving query efficiency while maintaining filtering accuracy.
Solution Approach 2:
The patent introduces a path pattern index as an intermediary data structure between the graph database and the query processor. This index acts as a mediator that stores pre-computed path information, allowing efficient retrieval and matching without direct path traversal during query execution.
2Reliability
If path traversal is performed for filtering, then filtering condition is satisfied, but computing resources are consumed
Solution Approach 1:
The system performs path pattern computation in advance and stores results in the path pattern index. During query execution, pre-computed paths are retrieved and matched against query conditions, eliminating the need for expensive real-time path traversal and reducing computing resource consumption while ensuring filtering conditions are met.
Solution Approach 2:
The patent creates a copy of path pattern information in the path pattern index, which can be efficiently queried and matched without traversing the actual graph paths. This copy mechanism allows filtering condition satisfaction through quick lookups rather than resource-intensive path traversals.
3Measurement precision
If path traversal is performed, then path pattern filtering is achieved, but query time increases
Solution Approach 1:
Path patterns are pre-computed and stored in the path pattern index before queries are executed. When a query arrives, the system performs quick lookups in the index rather than time-consuming path traversals, significantly reducing query time while maintaining accurate path pattern filtering.
Solution Approach 2:
The patent replaces the mechanical process of traversing graph paths during query execution with a more efficient data structure-based lookup system. The path pattern index enables filtering through index-based retrieval mechanisms rather than sequential path traversal, dramatically reducing query time.
Data Source
AI summary
This specification discloses a method. The method includes: when a received match statement includes a filtering condition of a path pattern, a node that matches a path in the path pattern is queried from all nodes in the graph database based on the path, to obtain a first node set. A node that meets a matching condition in the match statement is determined from all the nodes in the graph database based on the matching condition. For each node that meets the matching condition, whether the node falls within the first node set is determined. Whether the node belongs to a query result of the match statement is determined based on a determining result. Traversing, based on the path pattern, a path of a node that matches the match statement can be simplified as matching between a node and a node set.


