Re: Performance degradation of REFRESH MATERIALIZED VIEW

From: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Andres Freund <andres(at)anarazel(dot)de>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, Anastasia Lubennikova <a(dot)lubennikova(at)postgrespro(dot)ru>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Paul Guo <guopa(at)vmware(dot)com>
Subject: Re: Performance degradation of REFRESH MATERIALIZED VIEW
Date: 2021-05-11 13:58:20
Message-ID: 2524c5c8-9547-8eec-ee42-51d8430e995c@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 5/11/21 12:58 PM, Bharath Rupireddy wrote:
> On Tue, May 11, 2021 at 2:34 PM Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
>> I think the approach proposed by Andres eliminates the extra vmbuffer
>> reads as much as possible. But even with the patch, there still is 5%
>> degradation (and there is no way to disable inserting frozen tuples at
>> matview refresh). Which could be a problem for some users. I think
>> it’s hard to completely eliminate the overhead so we might need to
>> consider another approach like having matview refresh use
>> heap_multi_insert() instead of heap_insert().
>
> I may not have understood what's being discussed here completely, but
> if you want to use multi inserts for refresh matview code, maybe the
> "New Table Access Methods for Multi and Single Inserts" patches at
> [1], can help.
>

Maybe, but I think the main question is what to do for v14, so the
uncommitted patch is kinda irrelevant.

regards

--
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2021-05-11 14:07:43 Re: Another modest proposal for reducing CLOBBER_CACHE_ALWAYS runtime
Previous Message Amul Sul 2021-05-11 13:26:22 Re: [Patch] ALTER SYSTEM READ ONLY