IP Library Granted Patent US 11,275,741
Granted Patent B2
US 11,275,741 · App. 16/193,419 · Granted Mar 15, 2022

Merge join system and method

Inventor: Hun Soon Lee (Daejeon, KR)
Assignee: Electronics and Telecommunications Research Institute
G06F16/2456G06F7/14G06F16/2458
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,275,741
App. No.
16/193,419
Granted
Mar 15, 2022
Kind
B2
Abstract

A merge join method by a merge join system including a database is provided. The merge join system unequally divides data after a current position of a join column participating in merge join in the database into K partitions, K being greater than 2, and compares the first value of each of remaining partitions excluding the first partition from the K partitions with a value to be searched for the merge join, in order to check whether the first value and the value to be searched satisfy a specific condition. Further, the merge join system determines a partition in which the value to be searched is expected to exist based on a comparison result, and applies a k-ary search to the determined partition.

Claims (62)

1. A method performed by a processor of a merge join system including the processor and a database, the method comprising:

starting at a current position of a join column participating in merge join in the database, dividing data of the join column into K−1 (K being greater than 2) partitions each having a same first size, located after a location of the current position, and constructing a last partition of a second size different from the first size, the last partition containing data remaining in the join column and not included in the K−1 partitions after constructing the K−1 partitions;

comparing a first value of each of the K−1 partitions with a value to be searched for a merge join, in order to check whether the first value is within a range of the value to be searched;

determining a partition of the K−1 partitions and the last partition in which the value to be searched is expected to exist based on a comparison result; and

applying a k-ary search to the determined partition.

2. The method of claim 1 , wherein the second size is greater than the first size.

3. The method of claim 2 , further comprising, when the determined partition is the last partition, increasing a partition size to be used in a next search to a third size.

4. The method of claim 3 , wherein the third size is K times the first size.

5. The method of claim 3 , wherein the applying the k-ary search comprises:

dividing the last partition into Knew partitions of unequal size;

comparing a first value of each of remaining new partitions excluding a first new partition from the Knew partitions with the value to be searched in order to check whether a first value of each of the remaining new partitions is within the range of the value to be searched;

determining a new partition in which the value to be searched is expected to exist based on a comparison result; and

applying a k-ary search to the determined new partition.

6. The method of claim 2 , further comprising determining K ceil(log K Rate) as the first size,

wherein the ceil( ) is a function that maps an input to a least integer greater than or equal to the input, and

wherein the Rate is a first number divided by a second number, and the first number and the second number are a large number and a small number, respectively, between a number of data in the join column and a number of data in another column participating in the merge join.

7. The method of claim 1 , wherein the applying the k-ary search comprises performing the k-ary search, which equally divides the determined partition into K partitions, to the determined partition.

8. The method of claim 1 , wherein the comparing the first value comprises:

sequentially loading the first values of the K−1 partitions into a first vector register;

loading the value to be searched into a second vector register; and

performing a vector comparison on the first vector register and the second vector register to generate a comparison result mask,

wherein the determining the partition comprises determining the partition in which the value to be searched is expected to exist based on the comparison result mask.

9. The method of claim 8 , wherein the generating the comparison result mask comprises generating the comparison result mask by using a most significant bit of a comparison result between each element of the first vector register and a corresponding element of the second vector register.

10. A method performed by a processor of a merge join system including the processor and a database, the method comprising:

selecting a search method to be used for a current position of a join column participating in merge join in the database from among a plurality of search methods including a modified k-ary search; and

performing the modified k-ary search when the modified k-ary search is selected,

wherein the performing the modified k-ary search comprises:

dividing data of the join column into K−1 (K being greater than 2) partitions each having a same first size, located after a location of the current position, and constructing a last partition of a second size different from the first size, the last partition containing data remaining in the join column and not included in the K−1 partitions after constructing the K−1 partitions;

comparing a first value of each of the K−1 partitions with a value to be searched for a merge join, in order to check whether the first value is within a range of the value to be searched;

determining a partition of the K−1 partitions and the last partition in which the value to be searched is expected to exist based on a comparison result; and

applying a k-ary search to the determined partition.

11. The method of claim 10 , wherein the selecting the search method comprises:

estimating a cost based on a number of comparisons required for each of the plurality of search methods at the current position; and

selecting a search method which requires a least cost from among the plurality of search methods.

12. The method of claim 10 , wherein the plurality of searches further includes a sequential search,

wherein the selecting the search method comprises:

calculating a number of comparisons required for a k-ary search;

determining whether a value at a position apart from the current position by the number of comparisons is within the range of the value to be searched; and

selecting the sequential search when the value at the position apart from the current position is within the range of the value to be searched, and selecting the modified k-ary search when the value at the position apart from the current position is not within the range of the value to be searched.

13. The method of claim 12 , wherein the number of comparisons is determined as ceil (log K PartSize×(K−1)),

wherein the cell( ) is a function that maps an input to a least integer greater than or equal to the input, and

wherein the PartSize is a partition size used when dividing the data into the K−1 partitions.

14. The method of claim 13 , wherein the first size is the PartSize, and the second size is a size greater than the PartSize.

15. A system comprising:

a storage device that stores a database; and

a processor that:

upon using a modified k-ary search,

starting at a current position of a join column participating in merge join in the database, divides data of the join column into K−1 (K being greater than 2) partitions having a same first size located after a location of the current position, and constructs a last partition of a second size different from the first size, the last partition containing data remaining in the join column and not included in the K−1 partitions after constructing the K−1 partitions;

compares a first value of each of the K−1 partitions with a value to be searched for a merge join, in order to check whether the first value is within a range of the value to be searched;

determines a partition of the K−1 partitions and the last partition in which the value to be searched is expected to exist based on a comparison result; and

applies a k-ary search to the determined partition.

16. The merge join system of claim 15 , wherein the second size greater than the first size.

17. The system of claim 16 , wherein when the determined partition is the last partition, the processor increases a partition size to be used in a next search to K times the first size.

18. The system of claim 16 , wherein the processor determines K ceil(log K Rate) as the first size,

wherein the cell( ) is a function that maps an input to a least integer greater than or equal to the input, and

wherein the Rate is a first number divided by a second number, and the first number and the second number are a large number and a small number, respectively, between a number of data in the join column and a number of data in another column participating in the merge join.

19. The system of claim 15 , wherein the processor:

sequentially loads the first values of the K−1 partitions to a first vector register;

loads the value to be searched to a second vector;

performs a vector comparison on the first vector register and the second vector register to generates a comparison result mask; and

determines the partition in which the value to be searched is expected to exist based on the comparison result mask.

20. The system of claim 15 , wherein the processor estimates a cost based on a number of comparisons required for each of a plurality of search methods including the modified k-ary search at the current position, and selects a search method which requires a least cost from among the plurality of search methods.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 16, 2018
From: LEE, HUN SOON
To: ELECTRONICS AND TELECOMMUNICATIONS RESEARCH INSTITUTE
Reel/Frame 047526/0773 →
Priority Claims (1)
KR 10-2017-0171505 · Dec 13, 2017 · national
Continuity (1)
Related Publication 20190179818A1 · Jun 13, 2019