Compile-time optimizations of queries with SQL spreadsheet
First Claim
1. A method for determining orders for evaluating sets of formulas defined by queries, the method comprising the steps of:
- examining a query;
wherein said query evaluates to a relation;
wherein the query defines an array and a set of formulas that reference the array;
wherein the array has one or more dimensions that correspond to columns of the relation;
wherein a subset of formulas of the set of formulas require cells corresponding to a range of values of said dimension;
grouping, based on one or more criteria, the set of formulas into groups of formulas,wherein the groups are associated with an order, andwherein said one or more criteria include that, for each group of said groups of formulas, evaluation of any formula in said each group does not depend;
on another formula in said each group, andon another formula in a group higher in said order than said each group; and
evaluating in said order each group of said groups of formulas.
1 Assignment
0 Petitions
Accused Products
Abstract
Described herein are optimizations and execution strategies for spreadsheet extensions to SQL. The partitioning of data, as specified in a spreadsheet clause, provides a way to parallelize the computation of spreadsheet and to provide and improve scalability. Even if the partitioning is not explicitly specified in the spreadsheet clause, the database optimizer can automatically infer the partitioning in some cases. Efficient hash based access structures on relations can be used for symbolic array addressing, enabling fast computation of formulas. When rewriting SQL statements, formulas whose results are not referenced in outer blocks can be removed from the spreadsheet clause, thus removing unnecessary computations. The predicates from other query blocks can be moved inside query blocks with spreadsheets clauses, thus considerably reducing the amount of data to be processed. Conditions for validity of this transformation are given.
78 Citations
6 Claims
-
1. A method for determining orders for evaluating sets of formulas defined by queries, the method comprising the steps of:
-
examining a query; wherein said query evaluates to a relation; wherein the query defines an array and a set of formulas that reference the array; wherein the array has one or more dimensions that correspond to columns of the relation; wherein a subset of formulas of the set of formulas require cells corresponding to a range of values of said dimension; grouping, based on one or more criteria, the set of formulas into groups of formulas, wherein the groups are associated with an order, and wherein said one or more criteria include that, for each group of said groups of formulas, evaluation of any formula in said each group does not depend; on another formula in said each group, and on another formula in a group higher in said order than said each group; and evaluating in said order each group of said groups of formulas. - View Dependent Claims (2, 3)
-
-
4. A computer-readable storage medium carrying one or more sequences of instructions for determining orders for evaluating sets of formulas defined by queries, which instructions, executed by one or more processors, cause the one or more processors to perform:
-
examining a query; wherein said query evaluates to a relation; wherein the query defines an array and a set of formulas that reference the array; wherein the array has one or more dimensions that correspond to columns of the relation; wherein a subset of formulas of the set of formulas require cells corresponding to a range of values of said dimension; grouping, based on one or more criteria, the set of formulas into groups of formulas, wherein the groups are associated with an order, and wherein said one or more criteria include that, for each group of said groups of formulas, evaluation of any formula in said each group does not depend; on another formula in said each group, and on another formula in a group higher in said order than said each group; and evaluating in said order each group of said groups of formulas. - View Dependent Claims (5, 6)
-
Specification