IP Library Granted Patent US 7,085,769
Granted Patent B1
US 7,085,769 · App. 09/842,991 · Granted Aug 1, 2006

Method and apparatus for performing hash join

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 7,085,769
App. No.
09/842,991
Granted
Aug 1, 2006
Kind
B1
Abstract

A parallel hash ripple join algorithm partitions tuples of two relations for localized processing. The algorithm is non-blocking and may be performed in a parallel, multi-processor environment. At each processing node, the tuples are further partitioned such that join operations may be performed as tuples are redistributed to each node during the partitioning.

Claims (121)

1. A method comprising:

storing first tuples in a first table in a database system;

storing second tuples in a second table in the database system, wherein the first and second tuples are distributed across plural nodes of the database system;

partitioning the first and second tuples into plural portions;

redistributing the first and second tuples across the plural nodes according to the partitioning; and

hash joining the first and second tuples to produce result tuples as the first and second tuples are being redistributed across the plural nodes.

2. The method of claim 1 , further comprising:

retrieving the result tuples at random.

3. The method of claim 1 , wherein hash joining the first and second tuples to produce result tuples as the first and second tuples are being redistributed across the plural nodes comprises:

producing result tuples at one of the plural nodes; and

simultaneously producing result tuples at a second of the plural nodes.

4. The method of claim 1 , wherein redistributing the first and second tuples across the plural nodes comprises redistributing based on split vectors containing predefined ranges.

5. The method of claim 4 , wherein partitioning the first and second tuples into plural portions comprises:

partitioning first and second tuples into hash tables in each node.

6. The method of claim 5 , wherein hash joining the first and second tuples comprises:

allocating a portion of a memory to a first hash table;

allocating a second portion of the memory to a second hash table; and

hash joining first tuples in the first hash table with second tuples in the second hash table.

7. The method of claim 6 , wherein hash joining the first and second tuples comprises:

determining that the portion of the memory allocated to the first hash table is full;

allocating a stable storage to the first hash table; and

storing first tuples in the stable storage.

8. The method of claim 7 , further comprising:

continuing to store second tuples in the second hash table; and

hash joining second tuples in the second hash table with first tuples in the first hash table.

9. The method of claim 8 , further comprising:

determining that the second portion of the memory allocated to the second hash table is full;

allocating a second stable storage to the second hash table;

storing second tuples in the second stable storage; and

hash joining second tuples in the second stable storage with first tuples in the first hash table.

10. The method of claim 9 , wherein hash joining the first and second tuples comprises:

generating a third hash table once all first tuples and second tuples are redistributed to each node;

retrieving one of the first tuples from the stable storage;

hash joining the one of the first tuples with tuples in the second hash table; and

storing the one of the first tuples in the third hash table.

11. The method of claim 10 , further comprising:

retrieving one of the second tuples from the second stable storage; and

hash joining the one of the second tuples with tuples in the third hash table.

12. A database system comprising:

a plurality of nodes; and

one or more machine readable storage media containing instructions for enabling the database system to:

store first tuples in a first table distributed across the plurality of nodes;

store second tuples in a second table distributed across the plurality of nodes;

partition the first and second tuples into plural portions;

redistribute the first and second tuples to the plurality of nodes according to the partition; and

hash join the first and second tuples to produce result tuples as the first and second tuples are being redistributed to the plurality of nodes.

13. The database system of claim 12 , wherein the result tuples are available at random.

14. The database system of claim 12 , wherein each node comprises a memory, and wherein the instructions further partition the first and second tuples into plural portions by:

partitioning first tuples into first hash tables; and

partitioning second tuples into second hash tables, wherein the first and second hash tables are in corresponding memories of the nodes.

15. The database system of claim 14 , wherein the instructions further:

in each node, allocate a portion of the memory to a corresponding first hash table;

in each node, allocate a second portion of the memory to a corresponding second hash table; and

in each node, hash join first tuples in the first hash table with second tuples in the second hash table.

16. The database system of claim 15 , wherein the instructions further:

in each node, determine that the portion of the memory allocated to a corresponding first hash table is full; and

in each node, store first tuples in a stable storage in response to determining that the portion of the memory is full.

17. The database system of claim 16 , wherein the instructions further:

in each node, continue to store second tuples in a corresponding second hash table; and

in each node, hash join second tuples in the second hash table with first tuples in the first hash table.

18. The database system of claim 17 , wherein the instructions further:

in each node, determine that the second portion of the memory allocated to the second hash table is full;

in each node, allocate a second stable storage to the second hash table;

in each node, store second tuples in the second stable storage; and

in each node, hash join second tuples in the second stable storage with first tuples in the first hash table.

19. The database system of claim 18 , wherein the instructions further:

generate a third hash table once all first tuples and second tuples are redistributed to each node;

in each node, retrieve one of the first tuples from the stable storage;

in each node, hash join the one of the first tuples with tuples in the second hash table; and

in each node, store the one of the first tuples in the third hash table.

20. The database system of claim 19 , wherein the instructions further:

in each node, retrieve one of the second tuples from the second stable storage; and

in each node, hash join the one of the second tuples with tuples in the third hash table.

21. An article comprising a machine readable storage media storing instructions for enabling a processor-based system to:

store first tuples in a first table in a database system;

store second tuples in a second table in the database system, wherein the first and second tuples are distributed across plural nodes of the database system;

partition the first and second tuples into plural portions;

redistribute the first and second tuples across the plural nodes of the database system according to the partition; and

hash join the first and second tuples to produce result tuples as the first and second tuples are being redistributed across the plural nodes.

22. The article of claim 21 , further storing instructions for enabling a processor-based system to:

retrieve the result tuples once the hash join is performed.

23. The article of claim 22 , further storing instructions for enabling a processor-based system to:

redistribute based on split vectors containing predefined ranges.

24. The article of claim 23 , further storing instructions for enabling a processor-based system to:

partition first and second tuples into hash tables in each node.

25. The article of claim 24 , further storing instructions for enabling a processor-based system to:

allocate a portion of a memory to a first hash table;

allocate a second portion of the memory to a second hash table; and

hash join first tuples in the first hash table with second tuples in the second hash table.

26. The article of claim 25 , further storing instructions for enabling a processor-based system to:

determine that the portion of the memory allocated to the first hash table is full; and

store first tuples in a stable storage.

27. The article of claim 26 , further storing instructions for enabling a processor-based system to:

continue to store second tuples in the second hash table; and

hash join second tuples in the second hash table with first tuples in the first hash table.

28. The article of claim 27 , further storing instructions for enabling a processor-based system to:

determine that the second portion of the memory allocated to the second hash table is full;

allocate a second stable storage to the second hash table;

store second tuples in the second stable storage; and

hash join second tuples in the second stable storage with first tuples in the first hash table.

29. The article of claim 28 , further storing instructions for enabling a processor-based system to:

generate a third hash table once all first tuples and second tuples are redistributed to each node;

retrieve one of the first tuples from the stable storage;

hash join the one of the first tuples with tuples in the second hash table; and

store the one of the first tuples in the third hash table.

30. The article of claim 29 , further storing instructions for enabling a processor-based system to:

retrieve one of the second tuples from the second stable storage; and

hash join the one of the second tuples with tuples in the third hash table.

31. The method of claim 1 , wherein each of the nodes contains a first hash table to receive first tuples, and a second hash table to receive second tuples, the method further comprising:

storing redistributed first tuples in respective first hash tables; and

storing redistributed second tuples in respective second hash tables.

32. The method of claim 31 , wherein hash joining first tuples and second tuples comprises hash joining first tuples and second tuples from corresponding first and second hash tables.

33. The database system of claim 12 , wherein each of the nodes contains a first hash table to receive first tuples, and a second hash table to receive second tuples,

wherein the instructions further:

store redistributed first tuples in respective first hash tables; and

store redistributed second tuples in respective second hash tables.

34. The database system of claim 33 , wherein the instructions further hash join the first tuples and the second tuples from corresponding first and second hash tables.

35. The article of claim 21 , wherein each of the nodes contain a first hash table to receive first tuples, and a second hash table to receive second tuples, wherein the instructions when executed cause the processor-based system to further:

store redistributed first tuples in respective first hash tables; and

store redistributed second tuples in respective second hash tables.

36. The article of claim 35 , wherein hash joining first tuples and second tuples comprises hash joining first tuples and second tuples from corresponding first and second hash tables.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 21, 2007
From: NCR CORPORATION
To: TERADATA US, INC.
Reel/Frame 020540/0786 →