# US 10,372,690 B2 · Dynamic joining of database tables

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

- Number: US 10,372,690 B2
- Document ID: US10372690B2
- Status: Granted
- Kind: B2
- Application number: 15/377,380
- Filed: 2016-12-13
- Published: 2017-07-06
- Granted: 2019-08-06
- Earliest claimed: 2015-12-30
- Assignees: Teradata US, Inc.
- Applicants: Teradata US, Inc.
- Inventors: Sanjib Mishra; Rama Krishna Korlapati
- Web page: https://patentgrep.com/patent/US10372690B2

## CPC

- G06F 16/211: {Schema design and management}
- G06F 16/2282: {Tablespace storage structures; Management thereof}
- G06F 16/2456: {Join operations}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Disclosed are systems and methods for dynamic joining of database tables. The systems and methods can include: selecting a first table from a plurality of tables; selecting a second table from the plurality of tables; joining the first table and the second table to create a temporary table; and storing, in a memory of a computing device, the temporary table and the temporary skew value. The first table can have a first skew value. The second table can have a second skew value. The second skew value can be similar to the first skew value. The temporary table can have a temporary skew value.

## Claims

### Claim 1

A method comprising:
locating a hash code of skew values for each of a plurality of tables, each hash code of skew a values related to a skew value for a corresponding table of the plurality of tables,
selecting, by a computing device including a processor, a first table from the plurality of tables based on a located first hash code for the first table, the first table having a first skew value represented by the first hash code;
selecting, by the computing device, a second table from the plurality of tables based on a located second hash code for the second table, the second table having a second skew value represented by the second hash code, the second skew value being similar to the first skew value;
joining, by the computing device, the first table and the second table based on the first and second hash codes to create a temporary table, the temporary table having a temporary skew value;
determining skew statistics for the temporary table, wherein the skew statistics include a row count a number of distinct values, and hashes of high mode values and their corresponding frequency of columns of interest; and
storing, in a memory of the computing device, the temporary table, the temporary skew value, and the determined skew statistics.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
selecting a third table from the plurality of tables, the third table having a third skew value;
joining the temporary table with the third table to create a new temporary table, the new temporary table having a new temporary skew value; and
storing the new temporary table in the memory.

### Claim 3 (depends on 1)

The method of claim 1, wherein the plurality of tables are stored on a plurality of nodes.

### Claim 4 (depends on 1)

The method of claim 1, further comprising determining a skew value for each of the plurality of tables prior to selecting the first table and selecting the second table.

### Claim 5 (depends on 1)

The method of claim 1, wherein the first table and the second table are selected based on a hash code skew value for each of the first table and the second table.

### Claim 6 (depends on 1)

The system of claim 1, wherein the first table and the second table are selected based on a hash code skew value for each of the first table and the second table.

### Claim 7

A system comprising:
a processor; and
a memory that stores instructions that, when executed by the processor, cause the processor to perform operations comprising:
locating a hash code of skew values for each of a plurality of tables, each hash code of skew a values related to a skew value for a corresponding table of the plurality of tables,
selecting a first table from the plurality of tables based on a located first hash code for the first table, the first table having a first skew value represented by the first hash code,
selecting a second table from the plurality of tables based on a located second hash code for the second table, the second table having a second skew value represented by the second hash code, the second skew value being similar to the first skew value,
joining the first table and the second table based on the first and second hash codes to create a temporary table, the temporary table having a temporary skew value,
determining skew statistics for the temporary table, wherein the skew statistics include a row count a number of distinct values, and hashes of high mode values and their corresponding frequency of columns of interest, and
storing the temporary table, the temporary skew value, and the determined skew statistics in the memory.

### Claim 8 (depends on 7)

The system of claim 7, wherein the operations further comprise:
selecting a third table from the plurality of tables, the third table having a third skew value;
joining the temporary table with the third table to create a new temporary table, the new temporary table having a new temporary skew value; and
storing the new temporary table in the memory.

### Claim 9 (depends on 7)

The system of claim 7, wherein the plurality of tables are stored on a plurality of nodes.

### Claim 10 (depends on 7)

The system of claim 7, wherein the operations further comprise determining a skew value for each of the plurality of tables prior to selecting the first table and selecting the second table.

### Claim 11

A non-transitory computer-readable medium comprising
instructions that, when executed by a processor, cause the processor to perform operations comprising:
selecting a first table from a plurality of tables, the first table having a first skew value;
selecting a second table from the plurality of tables, the second table having a second skew value, the second skew value being similar to the first skew value;
joining the first table and the second table to create a temporary table, the temporary table having a temporary skew value;
determining skew statistics for the temporary table, wherein the skew statistics include a row count, a number of distinct values, and hashes of high mode values and their corresponding frequency of columns of interest; and
storing the temporary table, the temporary skew value, and the determined skew statistics.

### Claim 12 (depends on 11)

The non-transitory computer-readable medium of claim 11, wherein the operations further comprise:
selecting a third table from the plurality of tables, the third table having a third skew value;
joining the temporary table with the third table to create a new temporary table, the new temporary table having a new temporary skew value; and
storing the new temporary table in the memory.

### Claim 13 (depends on 11)

The non-transitory computer-readable medium of claim 11, wherein the plurality of tables are stored on a plurality of nodes.

### Claim 14 (depends on 11)

The non-transitory computer-readable medium of claim 11, wherein the operations further comprise determining a skew value for each of the plurality of tables prior to selecting the first table and selecting the second table.
