Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jGlz5-0006x4-5F for pgsql-general@arkaria.postgresql.org; Tue, 24 Mar 2020 16:00:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jGly5-0006A5-OY for pgsql-general@arkaria.postgresql.org; Tue, 24 Mar 2020 15:59:53 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jGly5-00068u-BE for pgsql-general@lists.postgresql.org; Tue, 24 Mar 2020 15:59:53 +0000 Received: from mail.bertschi.com ([194.147.70.69]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jGly1-0005NL-W1 for pgsql-general@lists.postgresql.org; Tue, 24 Mar 2020 15:59:52 +0000 Received: from mail.bertschi.com ([172.20.32.162]) by mail.bertschi.com with ESMTP id 02OFxlf6024920-02OFxlf8024920 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=OK) for ; Tue, 24 Mar 2020 16:59:47 +0100 Received: from dueexs11.bertschi.domain (172.20.32.161) by dueexs21.bertschi.domain (172.20.32.170) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Tue, 24 Mar 2020 16:59:47 +0100 Received: from dueexs11.bertschi.domain ([fe80::e4c2:7a17:4a03:74f5]) by dueexs11.bertschi.domain ([fe80::e4c2:7a17:4a03:74f5%14]) with mapi id 15.01.1847.003; Tue, 24 Mar 2020 16:59:46 +0100 From: Remund Alain To: "pgsql-general@lists.postgresql.org" Subject: avoid WAL for refresh of materialized view Thread-Topic: avoid WAL for refresh of materialized view Thread-Index: AdYB9Sbjnkh7mixhQzGwX5HhV0fToQ== Date: Tue, 24 Mar 2020 15:59:46 +0000 Message-ID: Accept-Language: de-CH, en-US Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.20.32.203] Content-Type: multipart/alternative; boundary="_000_e6b0ccfe181f45868304015db4029746bertschicom_" MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --_000_e6b0ccfe181f45868304015db4029746bertschicom_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi all We have PostgreSql 9.6 running and started to work with materialized views.= To refresh the materialized views, we set up a cron job that refreshes the= materialized views on a fix schedule. Since our materialized views cache quite some data, we noticed a considerab= le increase in WAL files. It seems, that every refresh of a materialized vi= ew is logged in the WAL. We tried to figure out how we can alter the materialized view to set it to = "UNLOGGED" but this does not seem possible. --> "alter materialized view xyz set UNLOGGED;" leads to "ERROR: "xyz" is = not a table, SQL state: 42809" Is there another way to avoid logging a refresh of a materialized view in t= he WAL? Kind regards, Alain Remund --_000_e6b0ccfe181f45868304015db4029746bertschicom_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi all

 

We have PostgreSql 9.6 running and started to work w= ith materialized views. To refresh the materialized views, we set up a cron= job that refreshes the materialized views on a fix schedule.

Since our materialized views cache quite some data, = we noticed a considerable increase in WAL files. It seems, that every refre= sh of a materialized view is logged in the WAL.

 

We tried to figure out how we can alter the material= ized view to set it to "UNLOGGED" but this does not seem possible= .

--> "alter materialized view xyz set UNLOGGE= D;" leads to "ERROR:  "xyz" is not a table, SQL st= ate: 42809"

 

Is there another way to avoid logging a refresh of a= materialized view in the WAL?

 

Kind regards,

Alain Remund

--_000_e6b0ccfe181f45868304015db4029746bertschicom_--