Re: Incremental View Maintenance, take 2 (design considerations)

From: Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
To: Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
Cc: Alexandre Felipe <o(dot)alexandre(dot)felipe(at)gmail(dot)com>, <pgsql-hackers(at)postgresql(dot)org>, "zmlpostgres(at)gmail(dot)com" <zmlpostgres(at)gmail(dot)com>
Subject: Re: Incremental View Maintenance, take 2 (design considerations)
Date: 2026-08-02 04:39:23
Message-ID: 20260802133923.a4492a2ee7cb73b10589497b@sraoss.co.jp
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 3 Jul 2026 19:11:16 +0900
Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp> wrote:

> On Wed, 1 Jul 2026 00:04:01 +0900
> Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp> wrote:
>
> > On Fri, 29 May 2026 23:14:17 +0900
> > Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp> wrote:
> >
> > > There are still various design trade-offs to consider, so comments and discussion
> > > on the overall direction would be greatly appreciated.
> >
> > While I'm still working on those design changes and scope reduction,
> > I've attached an updated patch to fix the broken test in the previous
> > patch set.
> >
> > I'll send another patch set reflecting those changes once it's ready.
>
> I've attached a reduced patch set excluding DISTINCT and aggregate support to
> reduce the review scope. I'm still working on the planned design changes, and
> I'll send another patch set reflecting those changes once they're ready.

I've attached updated patches. In the current version, a new boolean reloption
"incremental_view_maintenance" is introduced, and an Incrementally Maintainable
Materialized View (IMMV) is defined using the following syntax:

CREATE MATERIALIZED VIEW viewname WITH (incremental_view_maintenance) AS ...

Compared to the previous "CREATE INCREMENTAL MATERIALIZED VIEW", this syntax makes it
clearer that incremental view maintenance is a property of a materialized view. It also
avoids adding a new field to pg_class or introducing new syntax keyword (INCREMENTAL).

Currently, the new option can only be specified for materialized views and cannot
be changed after creation. The documentation update is not included yet.

I'm still working on the remaining design changes, and I'll send another patch
set reflecting those changes once they're ready.

Regards,
Yugo Nagata

--
Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>

Attachment Content-Type Size
v40-0004-Add-regression-tests-for-Incremental-View-Mainte.patch text/x-diff 136.2 KB
v40-0003-Add-Incremental-View-Maintenance-support.patch text/x-diff 90.7 KB
v40-0002-Add-relation-option-incremental_view_maintenance.patch text/x-diff 11.9 KB
v40-0001-Allow-to-prolong-life-span-of-transition-tables-.patch text/x-diff 6.0 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey Borodin 2026-08-02 06:12:34 Re: GiST multirange index scans can fail to return rows
Previous Message Pavel Stehule 2026-08-02 04:27:24 session variables again