Hybrid In-Memory BFS-DFS Graph Query Processing

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Relational database systems face challenges in efficiently processing graph queries due to suboptimal use of graph structure, high memory usage, and irregular access patterns, particularly when handling homogeneous and heterogeneous graphs, as existing methods do not leverage the graph structure effectively and result in excessive memory consumption and poor locality during neighbor traversals.

Innovation Solution

A hybrid in-memory BFS-DFS approach is integrated into relational database systems, combining breadth-first and depth-first neighbor traversal algorithms to optimize memory locality and pipeline friendliness, using compressed sparse rows (CSR) representation and specialized match operators to efficiently process graph pattern matching queries without exporting data to external engines.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If SQL join operators are used for graph queries, then existing SQL engine can process queries, but memory usage explodes and performance degrades due to scanning all vertices instead of leveraging graph structure

Engineering Contradiction:
ImproveAbility to process graph queriesVSAvoidMemory usage
Core Design Contradiction:
Adaptability or versatilityVSQuantity of substance

Solution Approach 1:

The patent extracts the graph traversal logic from general SQL join operations by introducing specialized graph table operators that directly access graph structures (CSR format) and perform neighbor traversals without scanning all vertices. This extraction enables efficient graph query processing while avoiding the memory explosion of traditional SQL joins.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent applies local quality by making the graph processing runtime pipeline-friendly with controlled memory footprint, allowing different parts of the system (graph operators vs. relational operators) to have optimized characteristics suited to their specific functions.

Inventive Principle:
Principle #3Local quality

2Manufacturing precision

If BFS traversal is used for graph queries, then all vertices at a given level are matched before next level, but memory footprint becomes large and pipeline execution is blocked

Engineering Contradiction:
ImproveSystematic level-by-level processingVSAvoidMemory footprint
Core Design Contradiction:
Manufacturing precisionVSQuantity of substance

Solution Approach 1:

The patent transforms the static BFS approach into a dynamic hybrid BFS-DFS execution model where the system can adaptively switch between breadth-first and depth-first traversal strategies based on query characteristics and data distribution, optimizing both memory usage and processing efficiency.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent segments the graph traversal into independent pipeline stages with controlled memory footprint, allowing results to be produced incrementally and shipped to downstream operators without materializing all intermediate results in memory.

Inventive Principle:
Principle #1Segmentation

3Quantity of substance

If DFS traversal is used for graph queries, then memory footprint is reduced and pipeline execution is enabled, but memory locality deteriorates and neighbor iteration efficiency decreases

Engineering Contradiction:
ImproveMemory footprintVSAvoidMemory locality
Core Design Contradiction:
Quantity of substanceVSLoss of energy

Solution Approach 1:

The patent implements dynamic traversal strategy selection that adapts between BFS and DFS based on query patterns, allowing the system to optimize for memory locality when beneficial while maintaining low memory footprint through controlled exploration depth.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent employs nested data structures (CSR format with compressed row pointers and column pointers) that enable efficient neighbor iteration by nesting neighbor information within vertex records, improving memory locality without increasing overall memory footprint.

Inventive Principle:
Principle #7Nested doll (Nesting)

4Adaptability or versatility

If graph queries are processed without leveraging graph structure, then SQL engine can be used, but neighbor traversal scans all vertices causing poor performance

Engineering Contradiction:
ImproveUse of existing SQL engineVSAvoidNeighbor traversal efficiency
Core Design Contradiction:
Adaptability or versatilityVSProductivity

Solution Approach 1:

The patent applies local quality by making the graph processing runtime pipeline-friendly with controlled memory footprint, allowing different parts of the system (graph operators vs. relational operators) to have optimized characteristics suited to their specific functions.

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The patent extracts the graph traversal logic from general SQL join operations by introducing specialized graph table operators that directly access graph structures (CSR format) and perform neighbor traversals without scanning all vertices.

Inventive Principle:
Principle #2Taking out (Extraction)

5Productivity

If hash-join is used for graph queries, then join operations are optimized, but hash table construction is repeated for every join and query increasing overhead

Engineering Contradiction:
ImproveJoin operation efficiencyVSAvoidHash table construction overhead
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The patent performs preliminary action by pre-building and caching graph structures (CSR format) and neighbor information before query execution, eliminating the need to reconstruct join structures for every query and reducing repeated computational overhead.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS11397732B2Hybrid in-memory BFS-DFS approach for computing graph queries involving complex path patterns including trees and cycles inside relational database systems
Publication Date: 2022.07.26 ORACLE INT CORP
  • US11397732B2 patent drawing
  • US11397732B2 patent drawing
  • US11397732B2 patent drawing

AI summary

An in-memory graph query runtime is integrated inside a database management system and is capable of performing simple patter-matching queries against homogeneous graphs. The runtime efficiently combines breadth-first (BFS) and depth-first (DFS) neighbor traversal algorithms to achieve a hybrid runtime that takes the best from both sides. As a result, the hybrid runtime is able to process arbitrarily large queries with a fixed amount of memory, optimizing for memory locality.