Re: DB size growing exponentially when materialized view refreshedconcurrently (postgres 9.6) - Mailing list pgsql-general

From Alban Hertroys
Subject Re: DB size growing exponentially when materialized view refreshedconcurrently (postgres 9.6)
Date
Msg-id E7117DA3-4D78-42C7-886A-7BF41CCD04F9@gmail.com
Whole thread Raw
In response to DB size growing exponentially when materialized view refreshedconcurrently (postgres 9.6)  (Vikas Sharma <shavikas@gmail.com>)
Responses Re: DB size growing exponentially when materialized view refreshedconcurrently (postgres 9.6)  (Vikas Sharma <shavikas@gmail.com>)
List pgsql-general
> On 25 Jun 2018, at 19:21, Vikas Sharma <shavikas@gmail.com> wrote:
>
> I am looking for advice in a issue where two materialized views are being refreshed concurrently and dbsize has grown
to150gb from 4gb in two days. 
>
> We use two materialized views to keep processed data for faster query results for a search function. Earlier
materializedviews were refreshed not concurrently and all was good on DB. 
>
> We changed mv refresh to concurrently to take advantage of simultaneous access when mv refreshed. Now the refresh
takesslightly longer and but DB size has grown exponentially. 
>
> I ran full vacuum on DB and size again reduced to 4gb from 150gb.

You did not disable or tune down autovacuum perchance?
With materialized view refreshes that often, you probably need fairly aggressive autovacuuming on that table - you can
tuneautovacuum parameters per table (see Storage parameters). That probably won't put you at 4GB, more around double
thatsize, but it should stay a reasonable size that way. 

Regards,

Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.



pgsql-general by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: Schema/Data conversion opensource tools from MySQL to PostgreSQL
Next
From: Adrian Klaver
Date:
Subject: Re: Using COPY to import large xml file