Re: Performance degradation of REFRESH MATERIALIZED VIEW

Tomas Vondra <tomas.vondra@enterprisedb.com>

From: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>, Andres Freund <andres@anarazel.de>, Kyotaro Horiguchi <horikyota.ntt@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>, Pavan Deolasee <pavan.deolasee@gmail.com>, Anastasia Lubennikova <a.lubennikova@postgrespro.ru>, Jeff Janes <jeff.janes@gmail.com>, Paul Guo <guopa@vmware.com>
Date: 2021-05-11T13:58:20Z
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.mshk@gmail.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



Commits

  1. Fix pg_visibility regression failure with CLOBBER_CACHE_ALWAYS

  2. Revert most of 39b66a91bd

  3. Fix COPY FREEZE with CLOBBER_CACHE_ALWAYS