# US 2021/0286816 A1 · System and method for disjunctive joins

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

- Number: US 2021/0286816 A1
- Document ID: US20210286816A1
- Status: Published application
- Kind: A1
- Application number: 17/105,406
- Filed: 2020-11-25
- Published: 2021-09-16
- Earliest claimed: 2020-03-13
- Assignees: Snowflake Inc.
- Applicants: Snowflake Inc.
- Inventors: Thierry Cruanes; Florian Andreas Funke; Guangyan Hu; Jiaqi Yan
- Web page: https://patentgrep.com/patent/US20210286816A1

## CPC

- G06F 16/24537: {of operators}
- G06F 16/24554: {Unary operations; Data partitioning operations}
- G06F 16/24556: {Aggregation; Duplicate elimination}
- G06F 16/2456: {Join operations}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Joining data using a disjunctive operator is described. An example computer-implemented method can include receiving a query that includes a first disjunctive predicate involving a first table and a second table. The method may also include determining a first set of rows from the first table and generating a filter from the first set of rows. The method may also further include applying the filter to the second table to generate a second set of rows. Additionally, the method may also include joining the first set of rows and the second set of rows using a first disjunctive operator of the first disjunctive predicate to generate a first results set.

## Claims

### Claim at position 1

What is claimed is:

### Claim 1

A method comprising:
receiving a query that includes a first disjunctive predicate involving a first table and a second table, wherein the second table includes a plurality of micro-partitions;
generating a first filter from a first set of rows of the first table, wherein the filter comprises a range bloom filter;
applying the first filter to the second table to generate a second set of rows, wherein the first filter removes at least one of the plurality of micro-partitions from processing for the first disjunctive predicate;
applying a second filter to the second set of rows, wherein the second filter removes at least one of the rows in the second set of rows; and
joining the first set of rows and the filtered second set of rows using a first disjunctive operator of the first disjunctive predicate to generate a first results set.

### Claim 2 (depends on 1)

The method of claim 1, wherein the second filter comprises a bloom filter.

### Claim 3 (depends on 2)

The method of claim 2, wherein the bloom filter is applied on a row-by-row basis to the second set of rows.

### Claim 4 (depends on 1)

The method of claim 1, wherein the range bloom filter includes a minimum and maximum value pair of at least portion of values from the first set of rows

### Claim 5 (depends on 1)

The method of claim 1, wherein the range bloom filter is applied to one or more micro-partitions of the second table.

### Claim 6 (depends on 5)

The method of claim 5, wherein each of the one or more micro-partitions comprises a file.

### Claim 7 (depends on 1)

The method of claim 1, further comprising:
determining the first set of rows from the first table.

### Claim 8 (depends on 7)

The method of claim 7, wherein the determining comprises:
scanning the first table using at least a condition.

### Claim 9 (depends on 1)

The method of claim 1, wherein the generating of the first filter comprises:
adding each row in the first set of rows to the range bloom filter.

### Claim 10 (depends on 9)

The method of claim 9, wherein the adding comprises:
adjusting at least one of a minimum and a maximum value of a range bloom filter based on at least a column value associated with the row.

### Claim 11 (depends on 1)

The method of claim 1, wherein the query includes a second query predicate using the first set of rows and a third set of rows generated from the second table.

### Claim 12 (depends on 11)

The method of claim 11, further comprising:
joining the first set of rows and the third set of rows using a second disjunctive operator of the second disjunctive predicate to generate a second results set.

### Claim 13 (depends on 12)

The method of claim 12, further comprising:
deduplicating the second results set using at least a row identifier for each of the first set of rows and the third set of rows.

### Claim 14 (depends on 13)

The method of claim 13, wherein the row identifiers are assigned to the first set of rows and the third set of rows prior to the joining of the first set of rows and the third set of rows.

### Claim 15

A non-transitory machine-readable medium storing instructions which, when executed by one or more processors of a computing device, cause the one or more processors to:
receive a query that includes a first disjunctive predicate involving a first table and a second table, wherein the second table includes a plurality of micro-partitions;
generate, with the one or more processors, a first filter from the first set of rows, wherein the filter comprises a range bloom filter;
apply the first filter to the second table to generate a second set of rows, wherein the first filter removes at least one of the plurality of micro-partitions from processing for the first disjunctive predicate;
apply a second filter to the second set of rows, wherein the second filter removes at least one of the rows in the second set of rows; and
join the first set of rows and the filtered second set of rows using a first disjunctive operator of the first disjunctive predicate to generate a first results set.

### Claim 16 (depends on 15)

The non-transitory machine-readable medium of claim 15, wherein the second filter comprises a bloom filter.

### Claim 17 (depends on 16)

The non-transitory machine-readable medium of claim 16, wherein the bloom filter is applied on a row-by-row basis to the second set of rows.

### Claim 18 (depends on 15)

The non-transitory machine-readable medium of claim 15, wherein the range bloom filter includes a minimum and maximum value pair of at least portion of values from the first set of rows

### Claim 19 (depends on 15)

The non-transitory machine-readable medium of claim 15, wherein the range bloom filter is applied to one or more micro-partitions of the second table.

### Claim 20 (depends on 19)

The non-transitory machine-readable medium of claim 19, wherein each of the one or more micro-partitions comprises a file.

### Claim 21 (depends on 15)

The non-transitory machine-readable medium of claim 15, wherein the query includes a second query predicate using the first set of rows and a third set of rows generated from the second table.

### Claim 22 (depends on 21)

The non-transitory machine-readable medium of claim 21, wherein the instructions further cause the computing device to:
join the first set of rows and the third set of rows using a second disjunctive operator of the second disjunctive predicate to generate a second results set.

### Claim 23 (depends on 22)

The non-transitory machine-readable medium of claim 22, wherein the instructions further cause the computing device to:
deduplicating the second results set using at least a row identifier for each of the first set of rows and the third set of rows.

### Claim 24

A system comprising:
a set of storage resources;
a query processor to,
receive a query that includes a first disjunctive predicate involving a first table and a second table, the first and second tables stored in the set of storage resources, wherein the second table includes a plurality of micro-partitions,
generate, with the query processor, a first filter from the first set of rows, wherein the filter comprises a range bloom filter,
apply the first filter to the second table to generate a second set of rows, wherein the first filter removes at least one of the plurality of micro-partitions from processing for the first disjunctive predicate,
apply a second filter to the second set of rows, wherein the second filter removes at least one of the rows in the second set of rows, and
join the first set of rows and the filtered second set of rows using a first disjunctive operator of the first disjunctive predicate to generate a first results set.

### Claim 25 (depends on 24)

The system of claim 24, wherein the second filter comprises a bloom filter.

### Claim 26 (depends on 25)

The system of claim 25, wherein the bloom filter is applied on a row-by-row basis to the second set of rows.

### Claim 27 (depends on 24)

The system of claim 24, wherein the range bloom includes a minimum and maximum value pair of at least portion of values from the first set of rows

### Claim 28 (depends on 24)

The system of claim 24, wherein the query includes a second query predicate using the first set of rows and a third set of rows generated from the second table.

### Claim 29 (depends on 28)

The system of claim 28, wherein the query processor further to join the first set of rows and the third set of rows using a second disjunctive operator of the second disjunctive predicate to generate a second results set.

### Claim 30 (depends on 29)

The system of claim 29, wherein the query processor further to deduplicate the second set of results set using at least a row identifier for each of the first set of rows and the third set of rows.
