Patent ID: 7844600

Claim:
A system, comprising: an interface logic, embodied on a computer-readable storage medium, to expose a set of interface actions to support a user-defined aggregate in a materialized view associated with a base table, the materialized view and the user-defined aggregate being associated with a user-defined aggregate context; an aggregate logic, embodied on a computer-readable storage medium, to support the user-defined aggregate through the user-defined aggregate context, where the user-defined aggregate context is configured to be invoked by at least one interface action from the set of interface actions based, at least in part, on data in the materialized view to facilitate incremental updating of the materialized view; where the aggregate logic includes an initialization logic to establish a location in the materialized view for the user-defined aggregate, to establish a location in the materialized view for the user-defined aggregate context, to establish a first value for one or more values associated with computing the user-defined aggregate, and to establish a first value for the user-defined aggregate; where the aggregate logic includes an update logic to selectively update the user-defined aggregate based, at least in part, on a data item received from the interface logic, the update being controlled, at least in part, by the user-defined aggregate context; where the user-defined aggregate context is one of, an instance of a user-defined data type that stores information to maintain the user-defined aggregate, an instance of a user-defined data type that stores executable instructions to maintain the user-defined aggregate, and an object that is an instance of a user-defined type; and where the system is to control a query rewrite logic associated with a database in which the base table resides to selectively rewrite a query to access the base table into a query to access the materialized view.