System and method for processing queries having an inner query block containing a grouping operator
AssigneeOracle Corporation
InventorAndrew Witkowski
Life of this patent
Estimating the term…
Abstract
Queries having a outer query block enclosing an inner query block, such as a reference to a view or a subquery, with a grouping operator, such as GROUP or DISTINCT, are transformed by merging the inner query block into the outer query block. The FROM clause of the transformed query includes the tables referenced in the FROM clauses of the outer query block and the inner query block. A new GROUP BY clause is created for the outer query block that contains the rowids of tables referenced in the FROM list of the original query and the expressions in the GROUP BY clause of the inner query block. The outer query block can be split if the outer query block also contains a GROUP BY or HAVING clause.
Claims30
A method of processing a query in a database system, comprising the computer-implemented steps of:
- receiving an original query that contains an inner query block with a grouping operator, said inner query block being embedded in an outer query block;
- transforming the original query into a transformed query by:
- removing the inner query block from the original query, and merging portions of the inner query block into the outer query block;
- and
- processing the transformed query.
A computer-readable medium bearing instructions for processing a query in a database system, said instructions, when executed, arranged for causing one or more processors to perform the steps of:
- receiving an original query that contains an inner query block with a grouping operator, said inner query block being embedded in an outer query block;
- transforming the original query into a transformed query by:
- removing the inner query block from the original query, and merging portions of the inner query block into the outer query block;
- and
- processing the transformed query.
Dependencies are inferred from the claim text.