IP Library Granted Patent US 8,200,657
Granted Patent B2
US 8,200,657 · App. 12/239,654 · Granted Jun 12, 2012

Processing cross-table non-boolean term conditions in database queries

Assignee: International Business Machines Corporation
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 8,200,657
App. No.
12/239,654
Granted
Jun 12, 2012
Kind
B2
Abstract

Processing non-Boolean term conditions in database queries. A query that is a request for data in a database is received and includes at least one uneven non-Boolean term condition that spans multiple tables in the database. The non-Boolean term condition is split into separate portions, each of the portions providing a Boolean term that can be satisfied by accessing one table in the database. The separate portions are executed independently to find at least one data result in the database that satisfies the Boolean term of each separate portion, and the data result from each separate portion are combined into a final result that satisfies the query.

Claims (33)

1. A method for searching for data in a database, the method comprising:

receiving a query that is a request for data in the database, wherein the query includes at least one uneven non-Boolean term condition including an OR condition that spans at least two tables of the database, wherein the OR condition includes two predicates;

splitting the at least one uneven non-Boolean term condition into a plurality of separate query portions that each provide a Boolean term satisfied by accessing a different particular one of the at least two tables, wherein each predicate is provided to a different one of the separate query portions;

executing the separate query portions independently of each other to find at least one data result in each of the at least two tables that satisfies the Boolean term of each separate query portion;

identifying at least one bridge table, wherein the at least one bridge table does not satisfy the at least one uneven non-Boolean term condition and has at least one column from each of the at least two tables; and

combining the data results from each separate query portion into a final result that satisfies the query, wherein the at least one bridge table is used to join each of the at least two tables to combine the data results.

2. The method of claim 1 wherein the data results include rows in a table found from the execution of the separate query portions, and wherein rows duplicated between the data results from the separate query portions are removed from one of the data results.

3. The method of claim 1 further comprising rewriting the query before splitting the non-Boolean term condition into separate query portions, such that the number of separate portions needed to be executed is reduced.

4. The method of claim 1 wherein the separate query portions are separate tasks, each task being executed independently at runtime to find the data results for the Boolean term associated with that task, and wherein a duplication of table accesses is minimized.

5. The method of claim 4 wherein the at least one bridge table is a duplicated one of the at least two tables that is referenced by one of the separate tasks, the duplicated table being used in the separate task.

6. The method of claim 4 wherein record IDs of an index to the database are found as data results and are combined together, and further comprising accessing and joining rows of different tables in the database pointed to by the record IDs to provide the final results table.

7. The method of claim 4 wherein the query is rewritten in disjunctive normal form before splitting the at least one non-Boolean term condition into separate tasks.

8. The method of claim 1 wherein the query does not include a UNION-type statement, and wherein the separate query portions are separate blocks of the query that are split by rewriting the query so that the separate blocks are on different sides of a created UNION-type statement, such that the separate blocks are executed independently.

9. A computer readable medium including program instructions implemented by a computer, the program instructions for searching for data in a database, the program instructions implementing steps comprising:

receiving a query that is a request for data in the database, wherein the query includes at least one uneven non-Boolean term condition including an OR condition that spans at least two tables of the database, wherein the OR condition includes two predicates;

splitting the at least one uneven non-Boolean term condition into a plurality of separate query portions that each provide a Boolean term satisfied by accessing a different particular one of the at least two tables, wherein each predicate is provided to a different one of the separate query portions;

executing the separate query portions independently of each other to find at least one data result in each of the at least two tables that satisfies the Boolean term of each separate query portion;

identifying at least one bridge table, wherein the at least one bridge table does not satisfy the at least one uneven non-Boolean term condition and has at least one column from each of the at least two tables; and

combining the data results from each separate query portion into a final result that satisfies the query, wherein the at least one bridge table is used to join each of the at least two tables to combine the data results.

10. The computer readable medium of claim 9 wherein the data results include rows in a table found from the execution of the separate query portions, and wherein rows duplicated between the data results from the separate query portions are removed from one of the data results.

11. The computer readable medium of claim 9 further comprising rewriting the query before splitting the non-Boolean term conditions into separate query portions, such that the number of separate portions needed to be executed is reduced.

12. The computer readable medium of claim 9 wherein the separate query portions are separate tasks, each task being executed independently at runtime to find the data results for the Boolean term associated with that task, and wherein a duplication of table accesses is minimized.

13. The computer readable medium of claim 10 wherein record IDs of an index to the database are found as data results and are combined together, and further comprising accessing and joining rows of different tables in the database pointed to by the record IDs to provide the final results table.

14. The computer readable medium of claim 9 wherein the query does not include a UNION-type statement, and wherein the separate query portions are separate blocks of the query that are split by rewriting the query so that the separate blocks are on different sides of a created UNION-type statement, such that the separate blocks are executed independently.

15. A system for searching for data in a database, the system comprising:

a storage device for storing data in a database, the data being referenced within a plurality of tables; and

a processor coupled to the storage device, the processor operative to receive a query that is a request for data in the database, wherein the query includes at least one uneven non-Boolean term condition including an OR condition that spans at least two tables of the database, wherein the OR condition includes two predicates,

wherein the processor is operative to split the at least one uneven non-Boolean term condition into a plurality of separate portions that each provide a Boolean term satisfied by accessing a different particular one of the at least two tables, wherein each predicate is provided to a different one of the separate query portions,

wherein the processor is operative to process the query by executing the separate portions independently of each other to find at least one data result in each of the at least two tables that satisfies the Boolean term of each separate query portion,

wherein the processor is operative to identify at least one bridge table, wherein the at least one bridge table does not satisfy the at least one uneven non-Boolean term condition and has at least one column from each of the at least two tables, and

wherein the data results from each separate query portion are combined into a final result that satisfies the query, wherein the at least one bridge table is used to join each of the at least two tables to combine the data results.

16. The system of claim 15 wherein the separate portions are separate tasks, each task being executed independently to find the data results for the Boolean term associated with that task, and wherein a duplication of table accesses is minimized.

17. The system of claim 9 wherein the query does not include a UNION-type statement, and wherein the separate query portions are separate blocks of the query that are split by rewriting the query so that the separate blocks are on different sides of a created UNION-type statement, such that the separate blocks are executed independently.

Assignments (3)
CORRECTIVE ASSIGNMENT TO CORRECT THE REMOVE PATENT NUMBERS 10342096;10671117; 10716375; 10716376;10795407;10795408; AND 10827591 PREVIOUSLY RECORDED AT REEL: 58314 FRAME: 657. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT. Recorded Feb 29, 2024
From: RAKUTEN, INC.
To: RAKUTEN GROUP, INC.
Reel/Frame 068066/0103 →
CHANGE OF NAME Recorded Dec 6, 2021
From: RAKUTEN, INC.
To: RAKUTEN GROUP, INC.
Reel/Frame 058314/0657 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 17, 2015
From: INTERNATIONAL BUSINESS MACHINES CORPORATION
To: RAKUTEN, INC.
Reel/Frame 035176/0373 →
Continuity (2)
Continuation 11046278 · Jan 28, 2005
Related Publication 20090019040A1 · Jan 15, 2009