Re: postgres materialized view refresh performance - Mailing list pgsql-general

From Ravi Krishna
Subject Re: postgres materialized view refresh performance
Date
Msg-id A096D7B4-39AB-486C-A8CF-62240F128D78@mail.com
Whole thread Raw
In response to Re: postgres materialized view refresh performance  (Philip Semanchuk <philip@americanefficient.com>)
Responses Re: postgres materialized view refresh performance  (Philip Semanchuk <philip@americanefficient.com>)
List pgsql-general
> My understanding is that when CONCURRENTLY is specified, Postgres implements the refresh as a series of INSERT,
UPDATE,
> and DELETE statements on the existing view. So the answer to your question is no, Postgres doesn’t create another
tableand 
> then swap it.

The INSERTS/UPDATE/DELETE happens only for the difference.  PG first creates a new temp table and then compares it with
the MV and detects the difference.  That is why for CONCURRENTLY, a unique index is required on the MV.


pgsql-general by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Hot backup in PostgreSQL
Next
From: Fabrízio de Royes Mello
Date:
Subject: Re: Conditional column filtering with pglogical replication