US 11,714,810 B2
Join-based containment for set operation-based sub query removal
Rafi Ahmed, Fremont, CA (US); and Srikanth Bellamkonda, Mountain View, CA (US)
Assigned to Oracle International Corporation, Redwood Shores, CA (US)
Filed by Oracle International Corporation, Redwood Shores, CA (US)
Filed on Mar. 25, 2021, as Appl. No. 17/213,034.
Prior Publication US 2022/0309062 A1, Sep. 29, 2022
Int. Cl. G06F 16/2453 (2019.01)
CPC G06F 16/24535 (2019.01) [G06F 16/24537 (2019.01)] 24 Claims
OG exemplary drawing
 
1. A computer-executed method, comprising:
a database management system transforming a query to produce a transformed query;
wherein the query includes a plurality of subqueries;
wherein said transforming the query comprises:
determining whether a pair of set operation-based subqueries, of the plurality of subqueries, satisfies join-and-set-operation-based containment criteria at least by:
identifying one or more tables that are not common among the pair of set operation-based subqueries as uncommon one or more tables;
determining the uncommon one or more tables are referenced in a particular subquery of the pair of set operation-based subqueries and are not referenced in any other subquery of the pair of set operation-based subqueries thereby determining a contained subquery and a container subquery of the pair of set operation-based subqueries; and
in response to determining that the uncommon one or more tables are referenced in the particular subquery of the pair of set operation-based subqueries and are not referenced in any other subquery of the pair of set operation-based subqueries, determining that the pair of set operation-based subqueries, satisfies the join-and-set-operation-based containment criteria;
in response to the database management system determining that the pair of set operation-based subqueries, of the plurality of subqueries, satisfies the join-and-set-operation-based containment criteria, performing subquery removal,
wherein the pair of set operation-based subqueries comprises the contained subquery and the container subquery, and
wherein said performing the subquery removal comprises eliminating one or more of the pair of set operation-based subqueries; and
executing the transformed query;
wherein the method is performed by one or more computing devices.