Re: Is there a way to avoid “refresh materialized view” generating WAL?

From: 李明 <liming185216(at)126(dot)com>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Is there a way to avoid “refresh materialized view” generating WAL?
Date: 2026-09-08 05:05:16
Message-ID: 945230D6-98A7-4D93-8B3E-12724BBD3B49@126.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-admin

ENV:
PG15.0(production),also tried pg19.3;

Reproduction:
Create table t_test_mv(id int,name varchar(100));
Insert into t_test_mv
Select id,id||’abcdef’ from generate_series(1,100000000) id;

\dt+ t_test_mv;—sizeOfTable

Create materialized view mv_test as select * from t_test_mv;

refresh materialized view mv_test;

You will find a lot of WAL generated in pg_wal
directory.

Thanks.

> 在 2026年9月8日,09:50,李明 <liming185216(at)126(dot)com> 写道:
> Hi all,
>
> We are using materialized view to speed up complex query,and found that every time we execute the command:refresh materialized view mv_name,it generated lots of WAL(the size is almost the same as the base table).
>
> I checked the manual but did not find a “unlog” for materialized view.
>
> So, Is there a way to avoid “refresh materialized view” generating WAL?or suppress it?
>
> Thanks advance for any advice.
>
>
> Ming

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Laurenz Albe 2026-09-08 05:49:19 Re: Is there a way to avoid “refresh materialized view” generating WAL?
Previous Message 李明 2026-09-08 01:50:24 Is there a way to avoid “refresh materialized view” generating WAL?