v1-0001-Avoid-calling-SetMatViewPopulatedState-if-possibl.patch
application/octet-stream
Filename: v1-0001-Avoid-calling-SetMatViewPopulatedState-if-possibl.patch
Type: application/octet-stream
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch v1-0001
Subject: Avoid calling SetMatViewPopulatedState if possible
| File | + | − |
|---|---|---|
| src/backend/commands/matview.c | 2 | 1 |
From b4af8a5917d03602b01c16695f57ebda63dc7483 Mon Sep 17 00:00:00 2001 From: ChangAo Chen <cca5507@qq.com> Date: Fri, 10 Apr 2026 11:26:11 +0800 Subject: [PATCH v1] Avoid calling SetMatViewPopulatedState if possible --- src/backend/commands/matview.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backend/commands/matview.c b/src/backend/commands/matview.c index f7d8007f796..6e242a2848f 100644 --- a/src/backend/commands/matview.c +++ b/src/backend/commands/matview.c @@ -296,7 +296,8 @@ RefreshMatViewByOid(Oid matviewOid, bool is_create, bool skipData, * Tentatively mark the matview as populated or not (this will roll back * if we fail later). */ - SetMatViewPopulatedState(matviewRel, !skipData); + if (RelationIsPopulated(matviewRel) == skipData) + SetMatViewPopulatedState(matviewRel, !skipData); /* Concurrent refresh builds new data in temp tablespace, and does diff. */ if (concurrent) -- 2.34.1