TRANSFORMING A QUERY TO REUSE STORED DATA
First Claim
1. A method comprising:
- storing a query;
before executing the query, analyzing content of the query to determine whether the query contains two or more sub-queries that, if executed, could cause generation of at least part of a data structure;
based at least in part on determining that the query contains the two or more sub-queries, transforming the query to a transformed query comprising;
a first transformed sub-query that, when executed, creates and stores the at least part of the data structure, andat least a second transformed sub-query that, when executed, uses the at least part of the data structure stored by the first transformed sub-query;
wherein the method is performed by one or more computing devices.
1 Assignment
0 Petitions
Accused Products
Abstract
Methods, computer systems, and stored instructions are described herein for transforming a query or execution plan to re-use stored data. A query processor stores a query or a representation thereof. Before executing the query, the query processor analyzes the query or representation to determine whether the query or representation could cause at least part of a data structure to be generated at least twice. Based at least in part on determining that the at least part of the data structure could be generated at least twice by the query or representation, the query processor transforms the query or representation. The transformed query or representation includes a first transformed sub-query or sub-operation that generates and stores the at least part of the data structure, and a second transformed sub-query or sub-operation uses the at least part of the data structure that was stored by the first transformed sub-query or sub-operation.
43 Citations
26 Claims
-
1. A method comprising:
-
storing a query; before executing the query, analyzing content of the query to determine whether the query contains two or more sub-queries that, if executed, could cause generation of at least part of a data structure; based at least in part on determining that the query contains the two or more sub-queries, transforming the query to a transformed query comprising; a first transformed sub-query that, when executed, creates and stores the at least part of the data structure, and at least a second transformed sub-query that, when executed, uses the at least part of the data structure stored by the first transformed sub-query; wherein the method is performed by one or more computing devices. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A method comprising:
-
receiving a representation of a query; before executing the representation, analyzing the representation to determine whether the representation, if executed, could cause two or more sub-operations to generate at least part of a data structure; based at least in part on determining that the representation contains the two or more operations, transforming the representation into a transformed representation that, when performed, causes a first transformed sub-operation that creates and stores the at least part of the data structure, and at least a second transformed sub-operation that uses the at least part of the data structure stored by the first transformed sub-operation; wherein the method is performed by one or more computing devices. - View Dependent Claims (10, 11, 12, 13)
-
-
14. One or more non-transitory computer-readable storage media storing instructions which, when executed, cause:
-
storing a query; before executing the query, analyzing content of the query to determine whether the query contains two or more sub-queries that, if executed, could cause generation of at least part of a data structure; based at least in part on determining that the query contains the two or more sub-queries, transforming the query to a transformed query comprising; a first transformed sub-query that, when executed, creates and stores the at least part of the data structure, and at least a second transformed sub-query that, when executed, uses the at least part of the data structure stored by the first transformed sub-query. - View Dependent Claims (15, 16, 17, 18, 19, 20, 21)
-
-
22. One or more non-transitory computer-readable storage media storing instructions which, when executed, cause:
-
receiving a representation of a query; before executing the representation, analyzing the representation to determine whether the representation, if executed, could cause two or more sub-operations to generate at least part of a data structure; based at least in part on determining that the representation contains the two or more operations, transforming the representation into a transformed representation that, when performed, causes a first transformed sub-operation that creates and stores the at least part of the data structure, and at least a second transformed sub-operation that uses the at least part of the data structure stored by the first transformed sub-operation. - View Dependent Claims (23, 24, 25, 26)
-
Specification