Described herein is a system for creating and maintaining materialized views. The maintenance of the materialized views is performed in a distributed manner that improves efficiency and performance in response to the queries for materialized views or views on top of the materialized views.