US 12,287,788 B2
Learned join cardinality estimation using a join graph representation
Seyed Mohammad Amin Kamali, Orleans (CA); Vincent Corvinelli, Mississauga (CA); and Calisto Zuzarte, Pickering (CA)
Assigned to International Business Machines Corporation, Armonk, NY (US)
Filed by International Business Machines Corporation, Armonk, NY (US)
Filed on Jun. 22, 2023, as Appl. No. 18/339,284.
Prior Publication US 2024/0427768 A1, Dec. 26, 2024
Int. Cl. G06F 7/00 (2006.01); G06F 16/2453 (2019.01); G06F 16/2455 (2019.01)
CPC G06F 16/24544 (2019.01) [G06F 16/2456 (2019.01)] 22 Claims
OG exemplary drawing
 
1. A computer-implemented method comprising:
building a join cardinality estimation model by:
generating a training query having a known join cardinality;
generating an adjacency matrix encoding a join graph of the training query, wherein, for a given query that joins a set of n tables, the respective adjacency matrix can be defined as an n×n matrix, where a value in the matrix at a position (i, j) is 1 if the table i is joined with table j and 0 otherwise;
encoding one side of a diagonal axis of the adjacency matrix; and
training the join cardinality estimation model using the encoded adjacency matrix and the known join cardinality;
performing an inference using the join cardinality estimation model, the inference comprising a predicted join cardinality for a query; and
executing a query execution plan for the query using the predicted join cardinality.