US 12,242,487 B2
Efficient compilation of bounded recursive graph queries on top of SQL based relational engine
Vlad Ioan Haprian, Zurich (CH); Lei Sheng, Foster City, CA (US); Laurent Daynes, Saint-Ismier (FR); Zhen Hua Liu, San Mateo, CA (US); Hugo Kapp, Zurich (CH); Marco Arnaboldi, Zurich (CH); Andrew Witkowski, Foster City, CA (US); Sungpack Hong, Palo Alto, CA (US); and Hassan Chafi, San Mateo, CA (US)
Assigned to Oracle International Corporation, Redwood Shores, CA (US)
Filed by Oracle International Corporation, Redwood Shores, CA (US)
Filed on Oct. 13, 2022, as Appl. No. 17/965,687.
Prior Publication US 2024/0126764 A1, Apr. 18, 2024
Int. Cl. G06F 16/2455 (2019.01); G06F 16/242 (2019.01)
CPC G06F 16/24566 (2019.01) [G06F 16/2433 (2019.01)] 22 Claims
OG exemplary drawing
 
1. A method comprising:
a database management system (DBMS) compiling a graph pattern matching query that includes a bounded recursive pattern query into a main SQL query, wherein:
the bounded recursive pattern query specifies a start variable, an end variable, a recursive pattern, and a bound expression defining at least a maximum number of repetitions of the recursive pattern;
the graph pattern matching query is issued against a heterogenous graph having vertices and edges stored in a plurality of tables;
compiling the graph pattern matching query into the main SQL query comprises:
unfolding the bounded recursive pattern query into a set of pattern specializations, wherein:
the set of pattern specializations is bounded by the bound expression; and
each of the pattern specializations is a mapping of each variable in the bounded recursive pattern query to a respective table of the plurality of tables;
generating individual SQL query blocks for the set of pattern specializations;
the main SQL query includes a UNION ALL condition between the individual SQL query blocks;
the DBMS executing the main SQL query, wherein executing the main SQL query generates a result for the graph pattern matching query.