Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-12163

Support for Materialized Views

    XMLWordPrintable

Details

    Description

      Problem

      A number of RDBMS system support Materialized Views, which wikipedia defines thus

      In computing, a materialized view is a database object that contains the results of a query. For example, 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 using an aggregate function.

      The process of setting up a materialized view is sometimes called materialization. This is a form of caching the results of a query, similar to memoization of the value of a function in functional languages, and it is sometimes described as a form of precomputation. As with other forms of precomputation, database users typically use materialized views for performance reasons, i.e. as a form of optimization.

      Materialized views which store data based on remote tables are also known as snapshots.[citation needed] (C. J. Date regards the phrase "materialized view" as a deprecated term for a "snapshot".)

      In any database management system following the relational model, a view is a virtual table representing the result of a database query. Whenever a query or an update addresses an ordinary view's virtual table, the DBMS converts these into queries or updates against the underlying base tables. A materialized view takes a different approach: the query result is cached as a concrete ("materialized") table (rather than a view as such) that may be updated from the original base tables from time to time. This enables much more efficient access, at the cost of extra storage and of some data being potentially out-of-date. Materialized views find use especially in data warehousing scenarios, where frequent queries of the actual base tables can be expensive.

      In a materialized view, indexes can be built on any column. In contrast, in a normal view, it's typically only possible to exploit indexes on columns that come directly from (or have a mapping to) indexed columns in the base tables; often this functionality is not offered at all.

      This ticket is for tracking the potential design & implementation for MariaDB.

      Background

      Various dialects are support by existing vendors, e.g.

      PostgreSQL
      {code}
      CREATE MATERIALIZED VIEW table_name
      [ (column_name [, ...] ) ]
      [ WITH ( storage_parameter [= value] [, ... ] ) ]
      [ TABLESPACE tablespace_name ]
      AS query
      [ WITH [ NO ] DATA ]
      {code}

      Oracle
      https://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_6002.htm

      SQL Server (Indexed Views)
      https://msdn.microsoft.com/en-us/library/ms191432.aspx

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              alvinr Alvin Richards (Inactive)
              Votes:
              17 Vote for this issue
              Watchers:
              17 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.