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 the steps of:
- receiving a query that requests N top ranking rows from groups of rows in a base table, wherein said ranking is based on a particular ranking criteria;
determining whether said received query satisfies one or more criteria for rewriting, wherein said criteria include that N be less than a minimum threshold number associated with a materialized view; and
if said received query satisfies said one or more criteria for rewriting, then rewriting said query to produce a rewritten query that references the materialized view.
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.
110 Citations
14 Claims
-
1. A method of rewriting queries, the method comprising the steps of:
-
receiving a query that requests N top ranking rows from groups of rows in a base table, wherein said ranking is based on a particular ranking criteria;
determining whether said received query satisfies one or more criteria for rewriting, wherein said criteria include that N be less than a minimum threshold number associated with a materialized view; and
if said received query satisfies said one or more criteria for rewriting, then rewriting said query to produce a rewritten query that references the materialized view. - View Dependent Claims (2, 3, 8, 9, 10)
-
-
4. A method of rewriting queries, the method comprising the steps of:
-
receiving a query that requests ranked results of an aggregate function applied to groups of 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. - View Dependent Claims (5, 6, 11, 12, 13)
-
-
7. A method of rewriting queries, the method comprising the steps of:
-
receiving a query that requests results of an aggregate function applied to groups of rows in a base table, wherein said aggregate function is one of a MAX function or MIN function;
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. - View Dependent Claims (14)
-
Specification