Patent ID: 7853604

Claim:
A method, comprising: making a determination to rewrite a query that contains an inline view to use a materialized view which has an inline view; wherein making a determination includes: accessing database metadata that defines said materialized view and said inline view of said materialized view as separate database objects, wherein said database metadata includes a materialized view definition describing characteristics of said materialized view and a separate inline view definition describing characteristics of said inline view of said materialized view; based on the separate inline view definition, determining that said inline view of the materialized view and said inline view of the query are equivalent; wherein the inline view of the materialized view varies textually from the inline view of the query; wherein the inline view of the materialized view comprises an expression that defines a query statement and is not a named view or tablet; and in response to making said determination to rewrite a query that contains an inline view to use a materialized view, rewriting said query to use said materialized view; and wherein the method is performed by one or more computing devices.