Data

Materialized Views

Description

A database object that contains the results of a query. It may be a local copy of data located remotely, or may be a subset of the rows and/or columns of a table or join result, or may be a summary based on an aggregation of a table's data.

Where to use

  • Complex reporting queries.
  • \n
  • Improving read performance.

Real World Example

Instead of joining 5 tables every time to show the 'Daily Sales Dashboard', a background job runs every hour and saves the result to a 'DailySales' table (view).

Code Example

class MaterializedViews:\n    def __init__(self):\n        pass\n\n    def execute(self):\n        print('Executing Materialized Views')