Updated on 2024-04-30 GMT+08:00

PG_MATVIEW

PG_MATVIEW provides the materialized view information of the current node. This view is supported only by clusters of 8.3.0 and later versions.

Table 1 PG_MATVIEW columns

Column

Type

Description

mvid

oid

OID of the materialized view.

build_mode

char

Build mode of the materialized view.

  • 'd': indicates "deferred", which means that data is contained in the materialized view only when the view is refreshed for the first time.
  • 'i': indicates "immediate", which means that the latest data is included when the materialized view is created.

refresh_method

char

'c' indicates that the data is completely refreshed.

refresh_mode

char

Refresh mode of the materialized view.

'd': indicates manual refresh.

'a': indicates that the materialized view is always active and is automatically refreshed in the background.

rewrite_enable

boolean

Indicates whether query rewriting of the materialized view is supported.

active

boolean

Indicates whether the materialized view needs to be refreshed.

relnum

Int

Number of materialized view base tables.

start_time

timestamptz

Time when the materialized view is refreshed for the first time. If this parameter is left blank, the first refresh time is the current time plus the interval.

interval

interval

Interval for refreshing the materialized view.

refresh_time

timestamptz

Last refresh time of the materialized view.