Techniques for coalescing subqueries
AssigneeOracle International Corporation
InventorsRafi Ahmed, Srikanth Bellamkonda
Life of this patent
Estimating the term…
Abstract
Methods for transforming queries that contain EXISTS and NOT EXISTS subqueries are provided. The methods provided transform original queries that contain EXISTS and/or NOT EXISTS subqueries in conjunctive or disjunctive combinations into transformed queries that coalesce the original EXISTS and/or NOT EXISTS subqueries into a reduced number of EXISTS and/or NOT EXISTS subqueries, thereby eliminating duplicative table accesses and join operations.
Claims32
A computer-implemented method for transforming a query, comprising:
- generating a transformed query for the query, wherein:
- the query includes a first subquery and a second subquery;
- both the first subquery and the second subquery are EXISTS subqueries;
- and
- generating the transformed query comprises coalescing the first subquery and the second subquery into a single subquery by eliminating either the first subquery or the second subquery and not replacing the eliminated subquery with any subquery.
A computer-implemented method for transforming a query, comprising:
- generating a transformed query for the query, wherein:
- the query includes a first subquery and a second subquery;
- both the first subquery and the second subquery are NOT EXISTS subqueries;
- and
- generating the transformed query comprises coalescing the first subquery and the second subquery into a single subquery by eliminating either the first subquery or the second subquery and not replacing the eliminated subquery with any subquery.
A computer-implemented method for transforming a query, comprising:
- generating a transformed query for the query, wherein:
- the query includes a first subquery and a second subquery;
- the first subquery is an NOT EXISTS subquery;
- the second subquery is an EXISTS subquery;
- one of the first subquery and second subquery contains at least one predicate that is not in the other of the first subquery and second subquery;
- and
- generating the transformed query comprises coalescing the first subquery and the second subquery into a single subquery by eliminating either the first subquery or the second subquery and not replacing the eliminated subquery with any subquery.
A computer-implemented method for transforming a query, comprising:
- generating a transformed query for the query, wherein:
- the query includes a first subquery and a second subquery;
- the first subquery is an NOT EXISTS subquery;
- the second subquery is an EXISTS subquery;
- and
- the first subquery is equivalent to the second subquery except that the first subquery is a NOT EXISTS subquery and the second subquery is an EXISTS subquery;
- the first subquery and the second subquery are disjunctive;
- and
- generating the transformed query comprises coalescing the first subquery and the second subquery into a true predicate.
A computer-readable storage medium storing instructions for transforming a query, wherein the instructions include instructions which, when executed by one or more processors, cause the one or more processors to perform steps of:
- generating a transformed query for the query, wherein:
- the query includes a first subquery and a second subquery;
- both the first subquery and the second subquery are EXISTS subqueries;
- and
- generating the transformed query comprises coalescing the first subquery and the second subquery into a single subquery by eliminating either the first subquery or the second subquery and not replacing the eliminated subquery with any subquery.
A computer-readable storage medium storing instructions for transforming a query, wherein the instructions include instructions which, when executed by one or more processors, cause the one or more processors to perform steps of:
- generating a transformed query for the query, wherein:
- the query includes a first subquery and a second subquery;
- both the first subquery and the second subquery are NOT EXISTS subqueries;
- and
- generating the transformed query comprises coalescing the first subquery and the second subquery into a single subquery by eliminating either the first subquery or the second subquery and not replacing the eliminated subquery with any subquery.
A computer-readable storage medium storing instructions for transforming a query, wherein the instructions include instructions which, when executed by one or more processors, cause the one or more processors to perform steps of:
- generating a transformed query for the query, wherein:
- the query includes a first subquery and a second subquery;
- the first subquery is an NOT EXISTS subquery;
- the second subquery is an EXISTS subquery;
- one of the first subquery and second subquery contains at least one predicate that is not in the other of the first subquery and second subquery;
- and
- generating the transformed query comprises coalescing the first subquery and the second subquery into a single subquery by eliminating either the first subquery or the second subquery and not replacing the eliminated subquery with any subquery.
A computer-readable storage medium storing instructions for transforming a query, wherein the instructions include instructions which, when executed by one or more processors, cause the one or more processors to perform steps of:
- generating a transformed query for the query, wherein:
- the query includes a first subquery and a second subquery;
- the first subquery is an NOT EXISTS subquery;
- the second subquery is an EXISTS subquery;
- and
- the first subquery is equivalent to the second subquery except that the first subquery is a NOT EXISTS subquery and the second subquery is an EXISTS subquery;
- the first subquery and the second subquery are disjunctive;
- and
- generating the transformed query comprises coalescing the first subquery and the second subquery into a true predicate.
Dependencies are inferred from the claim text.