Re: REFRESH MATERIALIZED VIEW and completion tag output - Mailing list pgsql-hackers

From Mark Dilger
Subject Re: REFRESH MATERIALIZED VIEW and completion tag output
Date
Msg-id 98E52A0E-9827-465F-974A-A1F41E6F8A70@enterprisedb.com
Whole thread Raw
In response to Re: REFRESH MATERIALIZED VIEW and completion tag output  (Fujii Masao <masao.fujii@oss.nttdata.com>)
List pgsql-hackers

> On Nov 5, 2020, at 4:45 PM, Fujii Masao <masao.fujii@oss.nttdata.com> wrote:
>
>
>
> On 2020/11/06 1:56, Mark Dilger wrote:
>>> On Nov 5, 2020, at 8:20 AM, Fujii Masao <masao.fujii@oss.nttdata.com> wrote:
>>>
>>> The patch that makes pg_stat_statements track the number of rows that
>>> REFRESH MATERIALIZED VIEW command processes was proposed at [1].
>>> When reviewing the patch, I just wondered why the completion tag output
>>> for REFRESH MATERIALIZED VIEW doesn't include the row count. Is this
>>> an intentional behavior? I've not found the past discussion about this yet.
>> Of 191 command tags, only 7 return the number of rows.  See src/include/tcop/cmdtaglist.h.  REFRESH MATERIALIZED
VIEWis similar to CREATE MATERIALIZED VIEW and also CREATE TABLE AS, which also do not return the row count. 
>
> Yes, so I was wondering if REFRESH MATERIALIZED VIEW also should use
> CMDTAG_SELECT like CREATE MATERIALIZED VIEW does.

For both CREATE MATERIALIZED VIEW and CREATE TABLE AS, ExecCreateTableAs() does:

  SetQueryCompletion(qc, CMDTAG_SELECT, queryDesc->estate->es_processed);

but ExecRefreshMatView() does nothing with it's QueryCompletion parameter.   I don't know why this case should behave
differentlythan the other two. 

—
Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company






pgsql-hackers by date:

Previous
From: Justin Pryzby
Date:
Subject: Re: Implementing Incremental View Maintenance
Next
From: Peter Smith
Date:
Subject: Re: extension patch of CREATE OR REPLACE TRIGGER