Re: Incremental View Maintenance, take 2

From: Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>
To: Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>
Cc: jian he <jian(dot)universality(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Incremental View Maintenance, take 2
Date: 2023-08-28 02:52:52
Message-ID: 20230828115252.c1b018605b9a0756a30c3382@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 28 Aug 2023 02:49:08 +0900
Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp> wrote:

> On Sun, 2 Jul 2023 10:38:20 +0800
> jian he <jian(dot)universality(at)gmail(dot)com> wrote:

I attahed the patches v29 updated to comments from jian he.
The changes from the previous includes:

- errors in documentations is fixed.
- remove unnecessary BEGIN from the test
- add isimmv column to pg_matviews system view
- fix a typo
- rebase to the master branch

>
> > ok. Now I really found a small bug.
> >
> > this works as intended:
> > BEGIN;
> > CREATE INCREMENTAL MATERIALIZED VIEW test_ivm AS SELECT i, MIN(j) as
> > min_j FROM mv_base_a group by 1;
> > INSERT INTO mv_base_a select 1,-2 where false;
> > rollback;
> >
> > however the following one:
> > BEGIN;
> > CREATE INCREMENTAL MATERIALIZED VIEW test_ivm1 AS SELECT MIN(j) as
> > min_j FROM mv_base_a;
> > INSERT INTO mv_base_a select 1, -2 where false;
> > rollback;
> >
> > will evaluate
> > tuplestore_tuple_count(new_tuplestores) to 1, it will walk through
> > IVM_immediate_maintenance function to apply_delta.
> > but should it be zero?
>
> This is not a bug because an aggregate without GROUP BY always
> results one row whose value is NULL.
>
> The contents of test_imv1 would be always same as " SELECT MIN(j) as min_j
> FROM mv_base_a;", isn't it?
>
>
> Regards,
> Yugo Nagata
>
> --
> Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>
>
>

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

Attachment Content-Type Size
v29-0001-Add-a-syntax-to-create-Incrementally-Maintainabl.patch text/x-diff 5.0 KB
v29-0002-Add-relisivm-column-to-pg_class-system-catalog.patch text/x-diff 5.9 KB
v29-0003-Allow-to-prolong-life-span-of-transition-tables-.patch text/x-diff 6.2 KB
v29-0004-Add-Incremental-View-Maintenance-support-to-pg_d.patch text/x-diff 4.0 KB
v29-0005-Add-Incremental-View-Maintenance-support-to-psql.patch text/x-diff 4.7 KB
v29-0006-Add-Incremental-View-Maintenance-support.patch text/x-diff 75.9 KB
v29-0007-Add-DISTINCT-support-for-IVM.patch text/x-diff 23.9 KB
v29-0008-Add-aggregates-support-in-IVM.patch text/x-diff 37.8 KB
v29-0009-Add-support-for-min-max-aggregates-for-IVM.patch text/x-diff 26.4 KB
v29-0010-Add-regression-tests-for-Incremental-View-Mainte.patch text/x-diff 57.3 KB
v29-0011-Add-documentations-about-Incremental-View-Mainte.patch text/x-diff 24.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2023-08-28 04:23:09 Re: [PoC] pg_upgrade: allow to upgrade publisher node
Previous Message Michael Paquier 2023-08-28 01:53:52 Re: pg_stat_get_backend_subxact() and backend IDs?