Reusing optimized query blocks in query processing
First Claim
1. A method of processing a query that comprises an outer query and a first inner query block, comprising the machine-implemented steps of:
- checking a data structure to determine whether a previously-generated query block information record corresponding to an already-processed first inner query block exists in the data structure, wherein the already-processed first inner query block corresponds to the first inner query block in a first state in an already-processed form;
if the previously-generated query block information record exists in the data structure, then establishing query block information for the first inner query block in the first state based on the previously-generated query block information record;
if the previously-generated query block information record does not exist in the data structure, then generating and storing the query block information, for the first inner query block in the first state, in a newly-generated query block information record in the data structure; and
based on the query block information for the first inner query block in the first state, determining a cost for a semantically equivalent query that includes the first inner query block in the first state;
wherein the semantic equivalent query is one of a plurality of semantically equivalent queries for which costs are determined; and
based on the costs, selecting and executing one of the plurality of semantically equivalent queries.
1 Assignment
0 Petitions
Accused Products
Abstract
Techniques for reusing optimized query blocks in query processing are provided. The techniques include checking a data structure to determine whether a previously-generated query block information record corresponding to an already-processed first inner query block exists in the data structure, where the already-processed first inner query block corresponds to the first inner query block in a first state in an already-processed form. If the previously-generated query block information record exists in the data structure, then query block information is established for the first inner query block in the first state based on the previously-generated query block information record. Then a cost is determined for a semantically equivalent query that includes the first inner query block in the first state based on the query block information for the first inner query block in the first state.
-
Citations
42 Claims
-
1. A method of processing a query that comprises an outer query and a first inner query block, comprising the machine-implemented steps of:
-
checking a data structure to determine whether a previously-generated query block information record corresponding to an already-processed first inner query block exists in the data structure, wherein the already-processed first inner query block corresponds to the first inner query block in a first state in an already-processed form; if the previously-generated query block information record exists in the data structure, then establishing query block information for the first inner query block in the first state based on the previously-generated query block information record; if the previously-generated query block information record does not exist in the data structure, then generating and storing the query block information, for the first inner query block in the first state, in a newly-generated query block information record in the data structure; and based on the query block information for the first inner query block in the first state, determining a cost for a semantically equivalent query that includes the first inner query block in the first state; wherein the semantic equivalent query is one of a plurality of semantically equivalent queries for which costs are determined; and
based on the costs, selecting and executing one of the plurality of semantically equivalent queries. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42)
-
Specification