# US 2025/0156416 A1 · Identification Of Primary And Foreign Keys

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

- Number: US 2025/0156416 A1
- Document ID: US20250156416A1
- Status: Published application
- Kind: A1
- Application number: 18/938,570
- Filed: 2024-11-06
- Published: 2025-05-15
- Earliest claimed: 2023-11-15
- Assignees: Dynatrace LLC
- Applicants: Dynatrace LLC
- Inventors: Thomas Krismayer; Otmar Ertl
- Web page: https://patentgrep.com/patent/US20250156416A1

## CPC

- G06F 16/24537: {of operators}
- G06F 16/2462: {Approximate or statistical queries}
- G06F 16/221: {Column-oriented storage; Management thereof}
- G06F 16/2456: {Join operations}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A computer-implemented method is presented for determining primary keys in a table of a database system. The method includes: determining a number of rows in the table; for a given column of the table, generating a probabilistic data structure for the given column, 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; computing a cardinality estimate for the given column using the probabilistic data structure; computing a ratio between the cardinality estimate for the given column and the number of rows in the table; comparing the ratio to a threshold; and designating the given column as a primary key for the table in response to the ratio being greater than the threshold.

## Claims

### Claim 1

A computer-implemented method for determining primary keys in a table of a database system, comprising:
determining, by a computer processor, a number of rows in the table;
for a given column of the table, generating, by the computer processor, a probabilistic data structure for the given column, 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;
computing, by the computer processor, a cardinality estimate for the given column using the probabilistic data structure;
computing, by the computer processor, a ratio between the cardinality estimate for the given column and the number of rows in the table;
comparing, by the computer processor, the ratio to a threshold; and
designating the given column as a primary key for the table in response to the ratio being greater than the threshold.

### 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 maximum number of distinct data elements that can be represented by the probabilistic data structure.

### Claim 3 (depends on 1)

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

### Claim 4 (depends on 1)

The method of claim 1 further comprises repeating the steps for each column of the table.

### Claim 5 (depends on 1)

A computer-implemented method for joining tables in a database system, comprises:
receiving, by a computer processor, an indicator for a first table to be joined;
determining, by the computer processor, a given column of the first table as a primary key according to claim 1;
receiving, by the computer processor, a join operation for joining the first table with a second table in the database system, where the join operation is based on the given column from the first table; and
joining, by the computer processor, the first table with the second table according to the join operation.

### Claim 6 (depends on 5)

The method of claim 5 further comprises determining foreign keys in the second table relative to the given column designated in the first table of a database system, where the first table is joined with the second table using the foreign keys.

### Claim 7 (depends on 6)

The method of claim 6 further comprises determining foreign keys in the second table relative to the given column in the first table by:
for a first column of the second table, generating, by the computer processor, another probabilistic data structure for the first column, where the another probabilistic data structure is partitioned into a plurality of registers and configuration parameters for the another probabilistic data structure includes a first recording parameter, base, that controls recording of data into the another probabilistic data structure;
computing, by the computer processor, a cardinality estimate for the first column using the another probabilistic data structure;
computing, by the computer processor, an inclusion coefficient between the first column of the second table relative to the given column of the first table based in part on the cardinality estimate for the first column;
comparing, by the computer processor, the inclusion coefficient to a threshold; and
designating the first column of the second table as a foreign key in response to the inclusion coefficient being greater than the threshold.

### Claim 8

A computer-implemented method for determining foreign keys in a second table relative to a given column designates as a primary key in a first table of a database system, comprising:
generating, by the computer processor, a first probabilistic data structure for the given column, where the first probabilistic data structure is partitioned into a plurality of registers and configuration parameters for the first probabilistic data structure includes a first recording parameter, base, that controls recording of data into the first probabilistic data structure;
for a first column of the second table, generating, by the computer processor, another probabilistic data structure, where the another probabilistic data structure is partitioned into a plurality of registers and configuration parameters for the another probabilistic data structure includes another recording parameter, base, that controls recording of data into the another probabilistic data structure;
computing, by the computer processor, a cardinality estimate for the first column using the another probabilistic data structure;
computing, by the computer processor, an inclusion coefficient for the first column of the second table in relation to the given column of the first table based in part on the cardinality estimate for the first column;
comparing, by the computer processor, the inclusion coefficient to a threshold; and
designating the first column of the second table as a foreign key in response to the inclusion coefficient being greater than the threshold.

### Claim 9 (depends on 8)

The method of claim 8 wherein the another 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 another probabilistic data structure.

### Claim 10 (depends on 8)

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

### Claim 11 (depends on 8)

The method of claim 8 further comprises repeating the steps for each column of the second table.

### Claim 12 (depends on 8)

The method of claim 8 further comprises computing, by the computer processor, a cardinality estimate for the given column using the first probabilistic data structure, wherein the inclusion coefficient is defined as Φ(B.Cj, A.Ci)=(|B.Cj|+|A.Ci|)J/|B.Cj|(1+J), where |B.Cj| is the cardinality estimate for the first column of the second table, |A.Ci| is the cardinality of the given column of the first table, and J is Jaccard similarity between the first column of the second table and the given column of the first table.

### Claim 13 (depends on 8)

The method of claim 8 wherein the inclusion coefficient is defined as
Φ
⁡
(
B
.
C
j
,
A
.
C
i
)
=
❘
"\[LeftBracketingBar]"
B
.
C
j
⋂
A
.
C
i
❘
"\[RightBracketingBar]"
❘
"\[LeftBracketingBar]"
B
.
C
j
❘
"\[RightBracketingBar]"
,
where the cardinality of the intersection between B.Cj and A.Ci, |B.Cj ∩A.Ci|, is calculated using the inclusion-exclusion principle.

### Claim 14 (depends on 8)

The method of claim 8 further comprises
computing, by the computer processor, an inclusion coefficient for the given column of the first table in relation to the first column of the second table based in part on the cardinality estimate for the first column;
comparing, by the computer processor, the inclusion coefficient to a threshold; and
designating the given column of the first table as a foreign key in response to the inclusion coefficient being greater than the threshold.

### Claim 15

A computer-implemented method for formulating a join operation in a database system, comprising:
receiving, by a computer processor, an indicator for a first table to be joined;
determining, by the computer processor, a given column of the first table as a primary key by
determining, by a computer processor, a number of rows in the table;
for a given column of the table, generating, by the computer processor, a probabilistic data structure for the given column;
computing, by the computer processor, a cardinality estimate for the given column using the probabilistic data structure;
computing, by the computer processor, a ratio between the cardinality estimate for the given column and the number of rows in the table;
comparing, by the computer processor, the ratio to a threshold;
designating the given column as a primary key for the table in response to the ratio being greater than the threshold;
determining, by the computer processor, foreign keys in a second table relative to the given column designated in the first table, where the determination is based in part on the probabilistic data structure;
receiving, by the computer processor, a join operation for joining the first table with the second table in the database system using the foreign keys; and
joining, by the computer processor, the first table with the second table according to the join operation.

### Claim 16 (depends on 15)

The method of claim 15 wherein determining foreign key in the second table includes generating another probabilistic data structure for a column of the second table, such that the determination is based on the probabilistic data structure and the another probabilistic data structure.

### Claim 17 (depends on 16)

The method of claim 16 wherein the another probabilistic data structure is same type and has same structure as the probabilistic data structure.

### Claim 18 (depends on 15)

The method of claim 15 further comprises determining foreign keys in the second table relative to the given column in the first table by
for a first column of the second table, generating, by the computer processor, another probabilistic data structure for the first column, where the another probabilistic data structure is partitioned into a plurality of registers and configuration parameters for the another probabilistic data structure includes a first recording parameter that controls recording of data into the another probabilistic data structure;
computing, by the computer processor, a cardinality estimate for the first column using the another probabilistic data structure;
computing, by the computer processor, an inclusion coefficient between the first column of the second table relative to the given column of the first table based in part on the cardinality estimate for the first column;
comparing, by the computer processor, the inclusion coefficient to a threshold; and
designating the first column of the second table as a foreign key in response to the inclusion coefficient being greater than the threshold.

### Claim 19 (depends on 18)

The method of claim 18 further comprises computing, by the computer processor, an inclusion coefficient Φ(B.Cj, A.Ci) between the first column of the second table B.Cj relative to the given column of the first table A.Ci, where the inclusion coefficient is defined as Φ(B.Cj, A.Ci)=(|B.Cj|+|A.Ci|)J/|B.Cj|(1+J), where |B.Cj| is the cardinality estimate for the first column of the second table, |A.Ci| is the cardinality of the given column of the first table, and J is Jaccard similarity between the first column of the second table and the given column of the first table.

### Claim 20 (depends on 18)

The method of claim 18 wherein the inclusion coefficient is defined as
Φ
⁡
(
B
.
C
j
,
A
.
C
i
)
=
❘
"\[LeftBracketingBar]"
B
.
C
j
⋂
A
.
C
i
❘
"\[RightBracketingBar]"
❘
"\[LeftBracketingBar]"
B
.
C
j
❘
"\[RightBracketingBar]"
,
where the cardinality of the intersection between B.Cj and A.Ci, |B.Cj ∩A.Ci|, is calculated using the inclusion-exclusion principle.

### Claim 21 (depends on 18)

The method of claim 18 further comprises determining foreign keys in the first table relative to the first column in the second table by
computing, by the computer processor, an inclusion coefficient between the given column of the first table relative to the first column of the second table based in part on the cardinality estimate for the first column and the cardinality estimate for the given column;
comparing, by the computer processor, the inclusion coefficient to a threshold; and
designating the given column of the first table as a foreign key in response to the inclusion coefficient being greater than the threshold.

### Claim 22 (depends on 21)

The method of claim 21 further comprises computing, by the computer processor, an inclusion coefficient is defined as Φ(A.Ci,B.Cj)=(|A.Ci|+B.Cj|)J/|A.Ci|+(1+J), where |A.Ci| is the cardinality estimate for the given column of the first table, |B.Cj| is the cardinality of the first column of the second table, and J is Jaccard similarity between the first column of the second table and the given column of the first table.

### Claim 23 (depends on 21)

The method of claim 21 wherein the inclusion coefficient is defined as
Φ
⁡
(
A
.
C
i
,
B
.
C
j
)
=
❘
"\[LeftBracketingBar]"
A
.
C
i
⋂
B
.
C
j
❘
"\[RightBracketingBar]"
❘
"\[LeftBracketingBar]"
A
.
C
i
❘
"\[RightBracketingBar]"
,
where the cardinality of the intersection between A.Ci and B.Cj, |A.Ci ∩B.Cj|, is calculated using the inclusion-exclusion principle.
