Rewrite of queries containing rank or rownumber or min/max aggregate functions using a materialized view
First Claim
Patent Images
1. A method of rewriting queries, the method comprising:
- a database computer system performing the steps of;
receiving a query that requests ranked results, each result produced by an aggregate function applied to a group of a plurality of groups of particular rows from;
a base table, ora join of base tables;
determining whether said received query satisfies one or more criteria for rewriting; and
if said received query satisfies said one or more criteria, then rewriting said query to produce a rewritten query that references a materialized view; and
wherein said materialized view ranks aggregate function results of said aggregate function applied to groups of said particular rows, said aggregate function results including an aggregate function result for each group of said groups of particular rows.
0 Assignments
0 Petitions
Accused Products
Abstract
Techniques are provided for improving efficiency of database systems, and in particular, to refreshing materialized views maintained by database systems and rewriting queries to access the materialized views. According to the approaches, a ranked materialized view is incrementally refreshed, and during the incremental refresh operation, rows in the partitions of the materialized view are ranked within the partitions.
103 Citations
6 Claims
-
1. A method of rewriting queries, the method comprising:
-
a database computer system performing the steps of; receiving a query that requests ranked results, each result produced by an aggregate function applied to a group of a plurality of groups of particular rows from; a base table, or a join of base tables; determining whether said received query satisfies one or more criteria for rewriting; and if said received query satisfies said one or more criteria, then rewriting said query to produce a rewritten query that references a materialized view; and wherein said materialized view ranks aggregate function results of said aggregate function applied to groups of said particular rows, said aggregate function results including an aggregate function result for each group of said groups of particular rows. - View Dependent Claims (2, 3)
-
-
4. A non-transitory computer-readable volatile or non-volatile medium storing one or more sequences of instructions which, when executed by one or more processors, causes the one or more processors to perform the steps of:
-
receiving a query that requests ranked results, each result produced by an aggregate function applied to a group of a plurality of groups of particular rows from; a base table, or a join of base tables; determining whether said received query satisfies one or more criteria for rewriting; and if said received query satisfies said one or more criteria, then rewriting said query to produce a rewritten query that references a materialized view; and wherein said materialized view ranks aggregate function results of said aggregate function applied to groups of said particular rows, said aggregate function results including an aggregate function result for each group of said groups of particular rows. - View Dependent Claims (5, 6)
-
Specification