On Thu, Jun 18, 2026 at 6:28 PM cca5507 <[email protected]> wrote: > > 5. A small suggestion > > After further consideration, I suggest using the condition: > > if (RelationIsPopulated(matviewRel) != !skipData) > > This is much more readable and intuitive compared to the original: > > if (RelationIsPopulated(matviewRel) == skipData) > > Especially when paired with the original call: > > SetMatViewPopulatedState(matviewRel, !skipData); > > Both are ok for me.
Thanks for the patch! I went with the following form:
if (RelationIsPopulated(matviewRel) != !skipData)
SetMatViewPopulatedState(matviewRel, !skipData);
Attached is an updated patch. I also adjusted the nearby comment and
expanded the commit message to explain the unnecessary pg_class update
and resulting dead tuple generation.
Barring any objections, I'm thinking to commit this.
Regards,
--
Fujii Masao
v3-0001-Avoid-unnecessary-matview-populated-state-updates.patch
Description: Binary data
