Re: Incremental View Maintenance, take 2 - Mailing list pgsql-hackers

From Yugo NAGATA
Subject Re: Incremental View Maintenance, take 2
Date
Msg-id 20230828160530.adde1e20f257d7d345989163@sraoss.co.jp
Whole thread Raw
In response to Re: Incremental View Maintenance, take 2  (Yugo NAGATA <nagata@sraoss.co.jp>)
Responses Re: Incremental View Maintenance, take 2
List pgsql-hackers
On Mon, 28 Aug 2023 11:52:52 +0900
Yugo NAGATA <nagata@sraoss.co.jp> wrote:

> On Mon, 28 Aug 2023 02:49:08 +0900
> Yugo NAGATA <nagata@sraoss.co.jp> wrote:
> 
> > On Sun, 2 Jul 2023 10:38:20 +0800
> > jian he <jian.universality@gmail.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

I found pg_dump test was broken, so attached the fixed version.

Regards,
Yugo Nagata

> 
> > 
> > > 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@sraoss.co.jp>
> > 
> > 
> 
> 
> -- 
> Yugo NAGATA <nagata@sraoss.co.jp>


-- 
Yugo NAGATA <nagata@sraoss.co.jp>

Attachment

pgsql-hackers by date:

Previous
From: torikoshia
Date:
Subject: Re: RFC: Logging plan of the running query
Next
From: Kyotaro Horiguchi
Date:
Subject: Strange presentaion related to inheritance in \d+