Re: EXPLAIN/EXPLAIN ANALYZE REFRESH MATERIALIZED VIEW

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Japin Li <japinli(at)hotmail(dot)com>
Cc: David Steele <david(at)pgmasters(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: EXPLAIN/EXPLAIN ANALYZE REFRESH MATERIALIZED VIEW
Date: 2021-03-05 11:48:45
Message-ID: CALj2ACXtR4S2EW347F13_71k9ie2QwgZe0DS+Bg5nUGELKzgQg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 5, 2021 at 9:32 AM Japin Li <japinli(at)hotmail(dot)com> wrote:
> On Thu, 04 Mar 2021 at 14:53, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
> > Thanks! I will look forward for more review comments.
> >
>
> v4-0001-Rearrange-Refresh-Mat-View-Code.patch
> ---------------------------------------------
>
> +static Oid
> +get_new_heap_oid(RefreshMatViewStmt *stmt, Relation matviewRel, Oid matviewOid,
> + char *relpersistence)
> +{
> + Oid OIDNewHeap;
> + bool concurrent;
> + Oid tableSpace;
> +
> + concurrent = stmt->concurrent;
> +
> + /* Concurrent refresh builds new data in temp tablespace, and does diff. */
> + if (concurrent)
> + {
> + tableSpace = GetDefaultTablespace(RELPERSISTENCE_TEMP, false);
> + *relpersistence = RELPERSISTENCE_TEMP;
> + }
>
> Since the concurrent only use in one place, I think we can remove the local variable
> concurrent in get_new_heap_oid().

Done.

> The others looks good to me.

Thanks.

Attaching v5 patch set for further review.

With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com

Attachment Content-Type Size
v5-0001-Rearrange-Refresh-Mat-View-Code.patch application/x-patch 18.0 KB
v5-0002-EXPLAIN-EXPLAIN-ANALYZE-REFRESH-MATERIALIZED-VIEW.patch application/x-patch 16.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Borisov 2021-03-05 11:49:00 Re: POC: GROUP BY optimization
Previous Message Ibrar Ahmed 2021-03-05 11:37:30 Re: POC: GROUP BY optimization