# US 2025/0094423 A1 · Join Order Optimization Using Setsketch

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2025/0094423 A1
- Document ID: US20250094423A1
- Status: Published application
- Kind: A1
- Application number: 18/822,792
- Filed: 2024-09-03
- Published: 2025-03-20
- Earliest claimed: 2023-09-18
- Assignees: Dynatrace LLC
- Applicants: Dynatrace LLC
- Inventors: Roland Kretschmer
- Web page: https://patentgrep.com/patent/US20250094423A1

## CPC

- G06F 16/24544: {Join order optimisation}
- G06F 16/2456: {Join operations}
- G06F 16/2282: {Tablespace storage structures; Management thereof}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A computer-implemented method is presented for joining tables in a database system. The method includes: a) receiving a request to join tables according to a join query; b) generating a probabilistic data structure for each table specified in the set of join operations; c) for each join operation, calculating a cardinality estimate of table resulting from a particular join operation using the probabilistic data structures for the tables to be joined; d) selecting a join operation in the set of join operations, where the selected join operation has the lowest cardinality estimate amongst the join operations; e) removing the selected join operation from the set of join operations; f) replacing the tables to be joined by the selected join operation with the joint of these tables in the set of join operations; and repeating steps c) to f) until the set of join operations comprises a single join operation.

## Claims

### Claim 1

A computer-implemented method for joining tables in a database system, comprising:
a) receiving, by a computer processor, a request to join three or more tables according to a join query, where the join query specifies a set of join operations and each join operation joins two tables with each other;
b) generating, by the computer processor, a probabilistic data structure for each table specified in the set of join operations, where the probabilistic data structure is partitioned into a plurality of registers and configuration parameters for the probabilistic data structure includes a first recording parameter, base, that controls recording of data into the probabilistic data structure;
c) for each join operation in the set of join operations, calculating, by the computer processor, a cardinality estimate of table resulting from a particular join operation using the probabilistic data structures for the tables to be joined;
d) selecting, by the computer processor, a join operation in the set of join operations, where the selected join operation has the lowest cardinality estimate amongst the join operations in the set of join operations;
e) removing, by the computer processor, the selected join operation from the set of join operations;
f) replacing, by the computer processor, the tables to be joined by the selected join operation with the joint of these tables in the set of join operations; and
g) repeating, by the computer processor, steps c) to f) until the set of join operations comprises a single join operation, thereby defining an order for joining tables in the join query.

### Claim 2 (depends on 1)

The method of claim 1 wherein the probabilistic data structure is updated in accordance with the first recording parameter and a second recording parameter, rate, such that changing a value of the first recording parameter and changing the number of registers sets the maximum number of distinct data elements that can be represented by the probabilistic data structure.

### Claim 3 (depends on 2)

The method of claim 2 wherein the value of the first recording parameter is greater than one and less than two.

### Claim 4 (depends on 1)

The method of claim 1 wherein calculating a cardinality estimate of table resulting from a particular join operation includes merging the probabilistic data structure for each table specified by the particular join operation.

### Claim 5 (depends on 1)

The method of claim 1 further comprises calculating a cardinality estimate using inclusion-exclusion principle.

### Claim 6 (depends on 1)

The method of claim 1 wherein selecting a join operation further comprises performing the selected join operation to form a new table and generating a probabilistic data structure for the new table.

### Claim 7 (depends on 6)

The method of claim 6 wherein performing a selected join operation includes one of a hash join or a sort merge join.

### Claim 8 (depends on 1)

The method of claim 1 wherein the set of join operations involves multiple columns of a table and further comprises generating a probabilistic data structure for each column of the table specified in the set of join operations.

### Claim 9 (depends on 1)

The method of claim 1 wherein the probabilistic data structure is SetSketch data structure.

### Claim 10 (depends on 1)

The method of claim 1 further comprises joining tables in the join query according to the order for joining tables.

### Claim 11

A computer-implemented method for joining tables in a database system, comprising:
a) receiving, by a computer processor, a request to join three or more tables according to a join query, where the join query specifies a set of join operations and each join operation joins two tables with each other;
b) generating, by the computer processor, a probabilistic data structure for each table specified in the set of join operations, where the probabilistic data structure is partitioned into a plurality of registers and configuration parameters for the probabilistic data structure includes a first recording parameter, base, that controls recording of data into the probabilistic data structure;
c) for each join operation in the set of join operations, calculating, by the computer processor, a cardinality estimate of table resulting from a particular join operation using the probabilistic data structures for the tables to be joined;
d) selecting, by the computer processor, a join operation in the set of join operations, where the selected join operation has the lowest cardinality estimate amongst the join operations in the set of join operations;
e) performing, by the computer processor, the selected join operation to form a new table and generating a probabilistic data structure for the new table;
f) removing, by the computer processor, the selected join operation from the set of join operations;
g) replacing, by the computer processor, the tables to be joined with the new table in the set of join operations;
h) repeating, by the computer processor, steps c) to g) until the set of join operations comprises a single join operation, thereby joining tables in the join query.

### Claim 12 (depends on 11)

The method of claim 11 wherein the probabilistic data structure is updated in accordance with the first recording parameter and a second recording parameter, rate, such that changing a value of the first recording parameter and changing the number of registers sets the maximum number of distinct data elements that can be represented by the probabilistic data structure.

### Claim 13 (depends on 12)

The method of claim 12 wherein the value of the first recording parameter is greater than one and less than two.

### Claim 14 (depends on 11)

The method of claim 11 wherein calculating a cardinality estimate of table resulting from a particular join operation includes merging the probabilistic data structure for each table specified by the particular join operation.

### Claim 15 (depends on 11)

The method of claim 11 further comprises calculating a cardinality estimate using inclusion-exclusion principle.

### Claim 16 (depends on 11)

The method of claim 11 wherein the set of join operations involves multiple columns of a table and further comprises generating a probabilistic data structure for each column of the table specified in the set of join operations.

### Claim 17 (depends on 11)

The method of claim 11 wherein the probabilistic data structure is SetSketch data structure.

### Claim 18

A computer-implemented method for joining tables in a database system, comprising:
a) receiving, by a computer processor, a request to join three or more tables according to a join query, where the join query specifies a set of join operations and each join operation joins two tables with each other;
b) generating, by the computer processor, a SetSketch data structure for each table specified in the set of join operations;
c) for each join operation in the set of join operations, calculating, by the computer processor, a cardinality estimate of table resulting from a particular join operation using the SetSketch data structures for the tables to be joined;
d) selecting, by the computer processor, a join operation in the set of join operations, where the selected join operation has the lowest cardinality estimate amongst the join operations in the set of join operations;
e) removing, by the computer processor, the selected join operation from the set of join operations;
f) replacing, by the computer processor, the tables to be joined by the selected join operation with the joint of these tables in the set of join operations; and
g) repeating, by the computer processor, steps c) to f) until the set of join operations comprises a single join operation, thereby defining an order for joining tables in the join query.
