Optimizing snowflake schema queries
First Claim
Patent Images
1. A method comprising:
- receiving inputs that represent a query and that, applied to a database, define independent snowflake schemas in which each snowflake schema includes one or more pairs of join tables from the query;
generating a subquery for each snowflake schema in which the subquery contains one or more join predicates that involve one or more attributes from one or more join tables of the snowflake schema;
computing, by a computing system, for each of the generated subqueries, an access plan for obtaining from one or more tables of the subquery'"'"'s snowflake schema data requested by the subquery;
executing the access plans to obtain each subquery'"'"'s results;
generating an anchor query that joins the results produced by the generated subqueries into a result equivalent to a result produced by the query; and
generating a logical plan for the anchor query that uses the results of the generated subqueries as table inputs of the logical plan.
9 Assignments
0 Petitions
Accused Products
Abstract
For a database query that defines a plurality of separate snowflake schemas, a query optimizer computes separately for each of the snowflake schemas a logical access plan for obtaining from that schema'"'"'s tables a respective record set that includes the data requested from those tables by that query. The query optimizer also computes a logical access plan for obtaining the query'"'"'s results from the record sets in which execution of the logical access plans thus computed will result.
-
Citations
25 Claims
-
1. A method comprising:
-
receiving inputs that represent a query and that, applied to a database, define independent snowflake schemas in which each snowflake schema includes one or more pairs of join tables from the query; generating a subquery for each snowflake schema in which the subquery contains one or more join predicates that involve one or more attributes from one or more join tables of the snowflake schema; computing, by a computing system, for each of the generated subqueries, an access plan for obtaining from one or more tables of the subquery'"'"'s snowflake schema data requested by the subquery; executing the access plans to obtain each subquery'"'"'s results; generating an anchor query that joins the results produced by the generated subqueries into a result equivalent to a result produced by the query; and generating a logical plan for the anchor query that uses the results of the generated subqueries as table inputs of the logical plan. - View Dependent Claims (2, 3, 10, 11, 12, 13, 24)
-
-
4. A system comprising:
-
one or more processors; and computer readable storage comprising instructions that are to cause the one or more processors to; accept input signals that represent a query that, applied to the database, define a plurality of independent snowflake schemas in which each snowflake schema includes one or more pairs of join tables from the query; generate a subquery for each snowflake schema in which the subquery contains one or more join predicates that involve one or more attributes from one or more join tables of the snowflake schema; compute, for each of the generated subqueries, an access plan for obtaining from one or more tables of the subquery'"'"'s snowflake schema data requested by the subquery; execute the access plans to obtain each subquery'"'"'s results; generate an anchor query that joins the results produced by the subqueries into a result equivalent to a result produced by the query; and generate a logical plan for the anchor query that uses the results of the generated subqueries as table inputs of the logical plan. - View Dependent Claims (5, 6, 14, 15, 16, 17, 18, 25)
-
-
7. A non-transitory computer readable storage medium containing machine readable instructions readable by a computer system that, when executed by the computer system, perform a method, said machine readable instructions comprising code to cause the computer system to:
-
accept input signals that represent a query that, applied to the database, defines a plurality of independent snowflake schemas in which each snowflake schema includes one or more pairs of join tables from the query; generate a subquery for each snowflake schema in which the subquery contains one or more join predicates that involve one or more attributes from one or more join tables of the snowflake schema; compute, for each of the generated subqueries, an access plan for obtaining from one or more tables of the subquery'"'"'s snowflake schema data requested by the subquery, in which the access plan is associated with projections of the database'"'"'s physical layout, in which the attribute values of the projections are stored in the physical layout according to respective sort orders of the projections, the access plan being for use in obtaining the results of the subqueries; execute the access plans for to obtain each subquery'"'"'s results; generate an anchor query that joins the results produced by the subqueries into a result equivalent to a result produced by the query; and generate a logical plan for the anchor query that uses the results of the generated subqueries as table inputs of the logical plan. - View Dependent Claims (8, 9, 19, 20, 21, 22, 23)
-
Specification