From: Alban Hertroys <haramrae@gmail.com>
To: Vikas Sharma <shavikas@gmail.com>
Cc: pgsql-general@postgresql.org
Subject: Re: DB size growing exponentially when materialized view refreshed concurrently (postgres 9.6)
Date: Mon, 25 Jun 2018 21:01:58 +0200
Message-ID: <E7117DA3-4D78-42C7-886A-7BF41CCD04F9@gmail.com> (raw)
In-Reply-To: <CAN6gwKy6EP4D9O5a1VmPM+YVOKGj7euuGPm9aZVkJHdcwgRtww@mail.gmail.com>
References: <CAN6gwKy6EP4D9O5a1VmPM+YVOKGj7euuGPm9aZVkJHdcwgRtww@mail.gmail.com>
> 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 to 150gb from 4gb in two days.
>
> We use two materialized views to keep processed data for faster query results for a search function. Earlier materialized views 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 takes slightly 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 tune autovacuum parameters per table (see Storage parameters). That probably won't put you at 4GB, more around double that size, 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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: haramrae@gmail.com, shavikas@gmail.com
Subject: Re: DB size growing exponentially when materialized view refreshed concurrently (postgres 9.6)
In-Reply-To: <E7117DA3-4D78-42C7-886A-7BF41CCD04F9@gmail.com>
References: <CAN6gwKy6EP4D9O5a1VmPM+YVOKGj7euuGPm9aZVkJHdcwgRtww@mail.gmail.com> <E7117DA3-4D78-42C7-886A-7BF41CCD04F9@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox