Re: Performance degradation of REFRESH MATERIALIZED VIEW - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: Performance degradation of REFRESH MATERIALIZED VIEW
Date
Msg-id 6ec13d24-af94-c8f7-8b92-52c53195256e@enterprisedb.com
Whole thread Raw
In response to Re: Performance degradation of REFRESH MATERIALIZED VIEW  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
Responses Re: Performance degradation of REFRESH MATERIALIZED VIEW  (Masahiko Sawada <sawada.mshk@gmail.com>)
Re: Performance degradation of REFRESH MATERIALIZED VIEW  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
OK,

As mentioned in the previous message, I've reverted most of 39b66a91bd.
It took a bit longer to test, because the revert patch I shared a couple
days ago was actually incorrect/buggy in one place.

I'm not entirely happy about the end result (as it does not really help
with TOAST tables), so hopefully we'll be able to do something about
that soon. I'm not sure what, though - we've spent quite a bit of time
trying to address the regression, and I don't envision some major
breakthrough.

As for the regression example, I think in practice the impact would be
much lower, because the queries are likely much more complex (not just a
seqscan from a table), so the query execution will be a much bigger part
of execution time.

I do think the optimization would be a win in most cases where freezing
is desirable. From this POV the problem is rather that REFRESH MV does
not allow not freezing the result, so it has to pay the price always. So
perhaps the way forward is to add "NO FREEZE" option to REFRESH MV, or
something like that.


regards

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



pgsql-hackers by date:

Previous
From: Marko Tiikkaja
Date:
Subject: Re: security_definer_search_path GUC
Next
From: Jeff Davis
Date:
Subject: Decoding of two-phase xacts missing from CREATE_REPLICATION_SLOT command