Re: does refreshing materialized view make the database bloat?

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: pgsql-general list <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: does refreshing materialized view make the database bloat?
Date: 2023-01-16 04:52:10
Message-ID: CACJufxHkmQGpXajgWhETjDvk1hO6mUEJ1o4F151z7DnT3OOXAA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Jan 14, 2023 at 11:49 AM David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> wrote:

> On Friday, January 13, 2023, jian he <jian(dot)universality(at)gmail(dot)com> wrote:
>
>>
>> Once we have the diff table, we perform set-based DELETE and INSERT
>>> operations against the materialized view, and discard both temporary
>>> tables.
>>>
>>
>> Here the temporary tables are "discard" meaning the temporary tables are
>> deleted and the temporary tables' spaces are reclaimed immediately?
>> Or the temporary tables are deleted and the spaces will be reclaimed by
>> another mechanism?
>>
>> simplify:does refreshing materialized view make the database bloat.
>>
>>
> The materialized view itself bloats. The temp tables are removed
> immediately (the “drop table” docs don’t say this explicitly though it the
> most logical behavior and implied by the fact it takes an access exclusive
> lock).
>
> David J.
>
>
Hi,
why the materialized view itself bloats. If no refresh then no bloat right?
If fresh then set based delete operation will make materialized view bloat?
I also found the same question online.
https://dba.stackexchange.com/questions/219079/bloat-on-materialized-views
Unfortunately nobody answered...

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2023-01-16 04:58:17 Re: does refreshing materialized view make the database bloat?
Previous Message vignesh C 2023-01-16 03:12:52 Re: Support logical replication of DDLs