IP Library Granted Patent US 7,644,083
Granted Patent B1
US 7,644,083 · App. 10/954,579 · Granted Jan 5, 2010

Efficiently performing inequality joins

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,644,083
App. No.
10/954,579
Granted
Jan 5, 2010
Kind
B1
Abstract

A database system is able to receive a query that specifies an inequality join involving at least a first relation and a second relation. A plurality of segments of the first relation are sorted in the cache. Each sorted segment of the first relation in the cache is compared with the second relation.

Claims (42)

1. A method executed by at least one processor in a database system having a persistent storage and a cache, comprising:

receiving a query to perform an inequality join involving at least a join column of a first relation and a join column of a second relation;

sequentially sorting segments of the first relation in the cache;

representing each of the sorted first relation segments as a corresponding balanced binary search tree in which duplicate values of the join column of the first relation are eliminated;

receiving a first sorted segment of the first relation in the cache;

comparing the first sorted segment of the first relation in the cache with the second relation using the corresponding balanced binary search tree; and

outputting a result of the query to a client station.

2. A method executed by at least one processor in a database system, the database system having a persistent storage and a cache, the method comprising

receiving the query that specifies an inequality join involving at least a first relation and a second relation;

sorting a plurality of segments of the first relation in the cache;

representing each of the sorted first relation segments as a corresponding balanced binary search tree in which duplicate values of the join column of the first relation are eliminated;

after sorting all the segments of the first relation in the cache, sequentially retrieving the sorted segments of the first relation into the cache and comparing each of the retrieved sorted segments of the first relation in the cache with the second relation; and

outputting results of the query to a client station.

3. The method of claim 2 , wherein comparing each of the retrieved sorted segments of the first relation in the cache with the second relation comprises:

determining an inequality join condition specified for the inequality join by the query; and

for a given row of the second relation, comparing the given row of the second relation with less than all rows in the sorted segment of the first relation in the cache, based on the inequality join condition and structure of the binary search tree.

4. The method of claim 2 , wherein the database system comprises a parallel database system having a plurality of nodes,

wherein the sorting and comparing are performed concurrently in the plurality of nodes.

5. The method of claim 2 , wherein sorting the segments of the first relation in the cache is performed instead of performing an external sort of the first relation in persistent storage.

6. An article comprising at least one computer-readable storage medium containing instructions that when executed cause at least one processor in a database system to:

receive a query that specifies an inequality join involving at least a join column of a first relation and a join column of a second relation;

sort a plurality of segments of the first relation in the cache;

represent each of the sorted segments of the first relation using a balanced binary search tree in which duplicate values of the join column of the first relation are eliminated;

compare each of the sorted segments of the first relation in the cache with the second relation using the balanced binary search trees; and

output a result of the query.

7. The article of claim 6 , wherein the comparing is performed after sorting each of the segments of the first relation in cache and prior to sorting a subsequent one of the segments of the first relation.

8. The article of claim 6 , wherein comparing a particular one of the sorted segments of the first relation in the cache with the second relation comprises comparing the particular sorted segment of the first relation in the cache with each row of the second relation.

9. The article of claim 8 , wherein comparing the particular sorted segment of the first relation in the cache with the second relation comprises:

determining an inequality join condition specified for the inequality join by the query; and

for a given row of the second relation, comparing the given row of the second relation with less than all rows in the particular segment of the first relation in the cache, based on the inequality join condition and structure of the corresponding balanced binary search tree.

10. The article of claim 6 , wherein sorting the segments of the first relation in the cache is performed instead of performing an external sort of the first relation in persistent storage.

11. The article of claim 6 , wherein the comparing is performed after all of the segments of the first relation have been sorted.

12. A database system, comprising:

a persistent storage to store at least a first relation and a second relation;

a cache;

a controller comprising at least one processor to:

receive a query that specifies an inequality join involving at least a join column of the first relation and a join column of the second relation;

sort a plurality of segments of the first relation in the cache rather than perform an external sort of the first relation in the persistent storage;

represent each of the sorted segments of the first relation using a balanced binary search tree in which duplicate values of the join column of the first relation are eliminated;

compare each sorted segment of the first relation in the cache with the second relation using a corresponding search tree; and

output a result of the query.

13. The database system of claim 12 , wherein the controller is adapted to perform the comparing after sorting all of the segments of the first relation in the cache.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 18, 2008
From: NCR CORPORATION
To: TERADATA US, INC.
Reel/Frame 020666/0438 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 30, 2004
From: SIREK, MARK W.
To: NCR CORPORATION
Reel/Frame 015860/0783 →