IP Library › Granted Patent US 11,222,016
Granted Patent B2
US 11,222,016 · App. 16/402,259 · Granted Jan 11, 2022

Dynamic combination of processes for sub-queries

Inventors: Shuo Li (Beijing, CN); Meng Wan (Beijing, CN); Xiaobo Wang (Beijing, CN); Xin Ying Yang (Beijing, CN)
Assignee: International Business Machines Corporation
G06F16/24549G06F16/2454G06F16/24524G06F16/24535G06F16/24539G06F16/24545G06F16/24557
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,222,016
App. No.
16/402,259
Granted
Jan 11, 2022
Kind
B2
Abstract

A tool for combining common processes shared by at least two or more sub-queries within a query is provided. The tool determines whether one or more sub set relationships are shared between the at least two or more sub-queries. Responsive to a determination that one or more sub set relationships are shared between the at least two or more sub-queries, the tool determines an order class for the at least two or more sub-queries based on the one or more sub set relationships, wherein determining the order class includes transforming the query to include one or more differing aspects within the single shared common process, with the one or more differing aspects arranged based, at least in part, on a query style, a query type, and a query function. Responsive to determining an access path for the query, the tool executes the access path during run-time for data accessing.

Claims (67)

1. A method for combining common processes shared by at least two or more sub-queries within a query, the method comprising:

marking, by the one or more computer processors, one or more common data processes shared between the at least two or more sub-queries;

combining, by the one or more computer processors, the one or more common data processes of the at least two or more sub-queries into a single shared common process;

determining, by the one or more computer processors, whether one or more sub set relationships are shared between the at least two or more sub-queries;

responsive to a determination that one or more sub set relationships are shared between the at least two or more sub-queries, determining, by the one or more computer processors, an order class for the at least two or more sub-queries based on the one or more sub set relationships, wherein determining the order class includes transforming the query to include one or more differing aspects within the single shared common process, with the one or more differing aspects arranged based, at least in part, on a query style, a query type, and a query function;

responsive to determining an access path for the query, executing, by the one or more computer processors, the access path during run-time for data accessing; and

replacing, by the one or more computer processors, an original location of the one or more common data processes with a signed node.

2. The method of claim 1 further comprising:

determining, by one or more computer processors, the query with the at least two or more sub-queries; and

scanning, by the one or more computer processors, the query to determine whether there are at least two or more sub-queries within the query.

3. The method of claim 1 , wherein determining whether one or more sub set relationships are shared between the at least two or more sub-queries, further comprises:

determining, by the one or more computer processors, whether the at least two or more sub-queries share a common data process and differ in at least one aspect of the common data process, wherein determining includes analyzing one or more respective predicates of the at least two or more sub-queries.

4. The method of claim 3 further comprising:

responsive to a determination that the at least two or more sub-queries share a common data process and differ in at least one aspect of the common data process, determining, by the one or more computer processors, one or more sub set relationships are shared between the at least two or more sub-queries; and

responsive to a determination that the at least two or more sub-queries do not share a common data process and do not differ in at least one aspect of the common data process, determining, by the one or more computer processors, one or more sub set relationships are not shared between the at least two or more sub-queries.

5. The method of claim 1 further comprising:

determining, by the one or more computer processors, an access path for the query;

determining, by the one or more computer processors, a cost associated with dynamically generating a temporary result set against a plurality of sub-queries reused by one or more other sub-queries;

determining, by the one or more computer processors, a cost associated with the at least two or more sub-queries of the query accessing one or more base tables; and

responsive to a determination that the cost associated with dynamically generating the temporary result set against the plurality of sub-queries reused by the one or more other sub-queries is less than the cost associated with the at least two or more sub-queries of the query accessing the one or more base tables, generating, by the one or more computer processors, an access path for the single shared common process, wherein the access path includes two or more different branches in a parse tree for each of two or more differing aspects within the single shared common process, wherein the two or more different branches return two or more results sets.

6. The method of claim 5 further comprising:

responsive to a determination that the cost associated with dynamically generating the temporary result set against the plurality of sub-queries reused by the one or more other sub-queries is less than the cost associated with the at least two or more sub-queries of the query accessing the one or more base tables, generating, by the one or more computer processors, a plurality of temporary results sets against the at least two or more sub-queries for adoption by the one or more other sub-queries instead of accessing the one or more base tables for results sets.

7. A computer program product for combining common processes shared by at least two or more sub-queries within a query, the computer program product comprising:

one or more computer readable storage media and program instructions stored on the one or more computer readable storage media, the stored program instructions comprising:

program instructions to mark one or more common data processes shared between the at least two or more sub-queries;

program instructions to combine the one or more common data processes of the at least two or more sub-queries into a single shared common process;

program instructions to determine whether one or more sub set relationships are shared between the at least two or more sub-queries;

responsive to a determination that one or more sub set relationships are shared between the at least two or more sub-queries, program instructions to determine an order class for the at least two or more sub-queries based on the one or more sub set relationships, wherein determining the order class includes transforming the query to include one or more differing aspects within the single shared common process, with the one or more differing aspects arranged based, at least in part, on a query style, a query type, and a query function;

responsive to determining an access path for the query, program instructions to execute the access path during run-time for data accessing; and

program instructions to replace an original location of the one or more common data processes with a signed node.

8. The computer program product of claim 7 , wherein the stored program instructions further comprise:

program instructions to determine the query with the at least two or more sub-queries; and

program instructions to scan the query to determine whether there are at least two or more sub-queries within the query.

9. The computer program product of claim 7 , wherein program instructions to determine whether one or more sub set relationships are shared between the at least two or more sub-queries further comprise:

program instructions to determine whether the at least two or more sub-queries share a common data process and differ in at least one aspect of the common data process, wherein determining includes analyzing one or more respective predicates of the at least two or more sub-queries.

10. The computer program product of claim 9 , wherein the stored program instructions further comprise:

responsive to a determination that the at least two or more sub-queries share a common data process and differ in at least one aspect of the common data process, program instructions to determine one or more sub set relationships are shared between the at least two or more sub-queries; and

responsive to a determination that the at least two or more sub-queries do not share a common data process and do not differ in at least one aspect of the common data process, program instructions to determine one or more sub set relationships are not shared between the at least two or more sub-queries.

11. The computer program product of claim 7 , wherein the stored program instructions further comprise:

program instructions to determine an access path for the query;

program instructions to determine a cost associated with dynamically generating a temporary result set against a plurality of sub-queries reused by one or more other sub-queries;

program instructions to determine a cost associated with the at least two or more sub-queries of the query accessing one or more base tables; and

responsive to a determination that the cost associated with dynamically generating the temporary result set against the plurality of sub-queries reused by the one or more other sub-queries is less than the cost associated with the at least two or more sub-queries of the query accessing the one or more base tables, program instructions to generate an access path for the single shared common process, wherein the access path includes two or more different branches in a parse tree for each of two or more differing aspects within the single shared common process, wherein the two or more different branches return two or more results sets.

12. The computer program product of claim 11 , wherein the stored program instructions further comprise:

responsive to a determination that the cost associated with dynamically generating the temporary result set against the plurality of sub-queries reused by the one or more other sub-queries is less than the cost associated with the at least two or more sub-queries of the query accessing the one or more base tables, program instructions to generate a plurality of temporary results sets against the at least two or more sub-queries for adoption by the one or more other sub-queries instead of accessing the one or more base tables for results sets.

13. A computer system for combining common processes shared by at least two or more sub-queries within a query, the computer system comprising:

one or more computer processors;

one or more computer readable storage media;

program instructions stored on at least one of the one or more computer readable storage media for execution by at least one of the one or more computer processors, the stored program instructions comprising:

program instructions to mark one or more common data processes shared between the at least two or more sub-queries;

program instructions to combine the one or more common data processes of the at least two or more sub-queries into a single shared common process;

program instructions to determine whether one or more sub set relationships are shared between the at least two or more sub-queries;

responsive to a determination that one or more sub set relationships are shared between the at least two or more sub-queries, program instructions to determine an order class for the at least two or more sub-queries based on the one or more sub set relationships, wherein determining the order class includes transforming the query to include one or more differing aspects within the single shared common process, with the one or more differing aspects arranged based, at least in part, on a query style, a query type, and a query function;

responsive to determining an access path for the query, program instructions to execute the access path during run-time for data accessing; and

program instructions to replace an original location of the one or more common data processes with a signed node.

14. The computer system of claim 13 , wherein the stored program instructions further comprise:

program instructions to determine the query with the at least two or more sub-queries; and

program instructions to scan the query to determine whether there are at least two or more sub-queries within the query.

15. The computer system of claim 13 , wherein program instructions to determine whether one or more sub set relationships are shared between the at least two or more sub-queries further comprise:

program instructions to determine whether the at least two or more sub-queries share a common data process and differ in at least one aspect of the common data process, wherein determining includes analyzing one or more respective predicates of the at least two or more sub-queries.

16. The computer system of claim 15 , wherein the stored program instructions further comprise:

responsive to a determination that the at least two or more sub-queries share a common data process and differ in at least one aspect of the common data process, program instructions to determine one or more sub set relationships are shared between the at least two or more sub-queries; and

responsive to a determination that the at least two or more sub-queries do not share a common data process and do not differ in at least one aspect of the common data process, program instructions to determine one or more sub set relationships are not shared between the at least two or more sub-queries.

17. The computer system of claim 13 , wherein program instructions to determine an access path for the query, further comprise:

program instructions to determine a cost associated with dynamically generating a temporary result set against a plurality of sub-queries reused by one or more other sub-queries;

program instructions to determine a cost associated with the at least two or more sub-queries of the query accessing one or more base tables; and

responsive to a determination that the cost associated with dynamically generating the temporary result set against the plurality of sub-queries reused by the one or more other sub-queries is less than the cost associated with the at least two or more sub-queries of the query accessing the one or more base tables, program instructions to generate an access path for the single shared common process, wherein the access path includes two or more different branches in a parse tree for each of two or more differing aspects within the single shared common process, wherein the two or more different branches return two or more results sets.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 3, 2019
From: LI, SHUO; WAN, MENG; WANG, XIAOBO; YANG, XIN YING
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 049069/0025 →
Continuity (2)
Continuation 15016763 · Feb 5, 2016
Related Publication 20190258639A1 · Aug 22, 2019
Cited By (1)
US 12,740,816