Review observations for partial REFRESH MATERIALIZED VIEW patc - Mailing list pgsql-hackers

From vellaipandiyan sm
Subject Review observations for partial REFRESH MATERIALIZED VIEW patc
Date
Msg-id CAGXjcjkHK8kNeTPzcvDDVZ_rjV4FwPFCncvwhhpOZooWa_VD1g@mail.gmail.com
Whole thread
Responses Re: Review observations for partial REFRESH MATERIALIZED VIEW patc
List pgsql-hackers

Hello hackers,

I reviewed the REFRESH MATERIALIZED VIEW ... WHERE patch and had a few questions around concurrency semantics.

  • The original DELETE -> INSERT approach exposing a consistency gap makes sense, especially once tuple locks disappear after DELETE. The newer FOR UPDATE + single-CTE approach seems safer, though I wonder whether overlapping refreshes could still encounter deadlock scenarios around UPSERT conflicts.
  • The CONCURRENTLY behavior also feels somewhat unintuitive here. With WHERE refreshes, the non-CONCURRENT path appears more permissive for writers than CONCURRENTLY WHERE, which seems opposite to the expectation established by normal REFRESH MATERIALIZED VIEW semantics.
  • It may also help to document the intended guarantees around overlapping partial refreshes and concurrent DML on base tables.

Overall, the use case seems quite valuable for selective high-churn refresh workloads.

Thanks for working on this patch.

Regards,

Vellaipandiyan

pgsql-hackers by date:

Previous
From: solai v
Date:
Subject: Re: [PATCH] Rebuild CHECK constraints after generated column SET EXPRESSION
Next
From: Chao Li
Date:
Subject: Fix pg_stat_wal_receiver to show CONNECTING status