In-Memory Reverse CSR Graph Indexing for Bidirectional RDBMS Traversal
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing relational database management systems (RDBMS) face performance issues in graph analytics due to the inefficiency of Compressed Sparse Row (CSR) representation, which only allows edge traversal in one direction, leading to suboptimal performance for various graph analyses, and constructing graphs outside or migrating data to dedicated engines increases complexity and costs.
Innovation Solution
The construction of both forward and reverse CSRs in-memory within RDBMS to enable bidirectional edge traversal, utilizing parallelism techniques to accelerate the creation of redundant CSR encodings from existing forward CSRs, reducing memory usage and construction time.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Quantity of substance
If CSR representation is used for graph indexing, then memory usage is reduced and edge traversal is enabled, but bidirectional traversal capability is lost
Solution Approach 1:
The patent creates a reverse CSR structure that inverts the conventional CSR approach by storing edges in reverse direction. Instead of storing edges from source to destination, the reverse CSR stores edges from destination to source, enabling bidirectional traversal while maintaining the memory efficiency of CSR representation.
Solution Approach 2:
The patent copies the CSR structure to create a reverse CSR structure. By duplicating the source and destination arrays with reversed roles, the system maintains the memory-efficient CSR format while adding bidirectional traversal capability through the mirrored structure.
2Loss of time
If forward CSR only is constructed, then construction time is reduced, but graph algorithm performance is suboptimal
Solution Approach 1:
The patent performs preliminary construction of the forward CSR structure, then uses it as a foundation to efficiently construct the reverse CSR structure. This preliminary action avoids redundant work by leveraging the already-computed forward CSR data to generate the reverse CSR, reducing total construction time while enabling optimized graph algorithm performance.
3Adaptability or versatility
If redundant CSR encodings are constructed, then bidirectional edge traversal is enabled, but memory usage increases
Solution Approach 1:
The patent changes the parameter interpretation of the CSR structure by creating a reverse version with swapped source and destination arrays. This parameter change enables bidirectional traversal without requiring completely separate data structures, optimizing the memory usage versus functionality trade-off.
4Device complexity
If RDBMS processes graph data as relational tables, then data management complexity is reduced, but graph analytics performance is worse
Solution Approach 1:
The patent introduces in-memory CSR structures as an intermediary between the relational table data and graph analytics operations. This intermediary layer transforms the relational data into graph-optimized representations that enable fast bidirectional traversal and graph algorithm execution, resolving the performance gap without requiring migration to dedicated graph databases.
Data Source
Figure 1A
Figure 1B
Figure 2
AI summary
In an embodiment, a computer obtains a mapping of a relational schema of a database to a graph data model. The relational schema identifies vertex table(s) that correspond to vertex type(s) in the graph data model and edge table(s) that correspond to edge type(s) in the graph data model. Each edge type is associated with a source vertex type and a target vertex type. Based on that mapping, a forward compressed sparse row (CSR) representation is populated for forward traversal of edges of a same edge type. Each edge originates at a source vertex and terminates at a target vertex. Based on the forward CSR representation, a reverse CSR representation of the edge type is populated for reverse traversal of the edges of the edge type. Acceleration occurs in two ways. Values calculated for the forward CSR are reused for the reverse CSR. Elastic and inelastic scaling may occur.