US 11,720,564 B2
Optimization of database sequence of joins for reachability and shortest path determination
Daniele Pini, Rome (IT); Giovanni Tumarello, Bergamo (IT); and Renaud Delbru, Gradignan (FR)
Assigned to Sindice Limited, Galway (IE)
Filed by Sindice Limited, Galway (IE)
Filed on Sep. 7, 2022, as Appl. No. 17/939,525.
Application 17/939,525 is a continuation of application No. PCT/EP2021/055929, filed on Mar. 9, 2021.
Claims priority of application No. 20161921 (EP), filed on Mar. 9, 2020.
Prior Publication US 2022/0414098 A1, Dec. 29, 2022
Int. Cl. G06F 16/00 (2019.01); G06F 16/2453 (2019.01); G06F 16/22 (2019.01); G06F 16/2455 (2019.01); G06F 16/248 (2019.01)
CPC G06F 16/24544 (2019.01) [G06F 16/2246 (2019.01); G06F 16/248 (2019.01); G06F 16/24552 (2019.01)] 20 Claims
OG exemplary drawing
 
1. A method for performing an operation on a relational database comprising a plurality of records represented in one or more tables, to return a set of paths from a source node identified in one of said records to a target node identified in another of said records, with records of the database identifying edges between pairs of connected nodes, and wherein each of the returned path is a shortest path through said records from the source node to the target node, the method comprising:
a. receiving a request specifying a source node u, a target node v, and a maximum path length L;
b. iteratively testing each path length l from 1 to L, wherein testing a path length l comprises:
1. generating a query comprising a sequence of database join operations for the path length l which connect the source node u to the target node v;
2. generating a sequence of one or more tree-structured queries comprising semi-join operations of said database, said sequence of tree-structured queries representing a decomposition of said sequence of join operations;
3. executing the semi-join operations of each tree-structured query for the path length l, wherein each tree-structured query returns either an empty result set or a non-empty result set, a non-empty result set comprising a set of edges representing a path through the database records from the source node u to the target node v;
4. in the event that any of the tree-structured queries for the path length l returns an empty result set, terminating the execution of semi-join operations for the path length l and advancing the iteration to the next path length l+1;
5. in the event that all of the tree-structured queries for the path length l return non-empty result sets, terminating the iterative testing procedure and storing the non-empty result sets for the path length l; and
c. returning the shortest path(s) specified in the, or each, stored result set for the path length l at which the iterative testing terminated;
wherein step (iii) of executing the semi join operations of each tree-structured query for the path length l comprises determining, for a semi join operation of the tree- structured query, whether the result of that semi-join operation is stored in a cache from a preceding tree-structured query for the path length l or from a tree-structured query from a preceding path length k where 1≤k<1, and:
if the determination is positive, retrieving the result from the cache without repeating the semi-join operation; or
if the determination is negative, performing the semi-join operation and storing the result thereof in said cache.