Re: enable pg_stat_statements to track rows processed by REFRESH MATERIALIZED VIEW

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: Seino Yuki <seinoyu(at)oss(dot)nttdata(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: enable pg_stat_statements to track rows processed by REFRESH MATERIALIZED VIEW
Date: 2020-11-12 02:28:32
Message-ID: f2193779-62b2-a091-b553-739389630515@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020/11/10 17:29, Fujii Masao wrote:
>
>
> On 2020/11/05 23:54, Seino Yuki wrote:
>> 2020-11-02 20:01 に Fujii Masao さんは書きました:
>>> On 2020/11/02 14:02, Yuki Seino wrote:
>>>> The following review has been posted through the commitfest application:
>>>> make installcheck-world:  tested, passed
>>>> Implements feature:       tested, passed
>>>> Spec compliant:           tested, passed
>>>> Documentation:            tested, passed
>>>>
>>>> +1.
>>>> I checked the patch and there were no problems.
>>>
>>> +        PG_END_TRY();
>>> +        SetQueryCompletion(qc, CMDTAG_REFRESH_MATERIALIZED_VIEW, processed);
>>>
>>> Isn't it better to call SetQueryCompletion() in ExecRefreshMatView()
>>> instead of ProcessUtilitySlow() (e.g., ExecCreateTableAs() does)?
>>>
>>> Regards,
>>
>>
>> Sorry. I missed it.
>> I've incorporated your point into this patch.
>> So the changes to "matview.h" and "utility.c" have been canceld.
>>
>> We also confirmed that the new patch passed the regression test.
>
> Thanks for updating the patch!
>
> +    /* save the rowcount if we're given a qc to fill */
> +    SetQueryCompletion(qc, CMDTAG_REFRESH_MATERIALIZED_VIEW, processed);
>
> I added the check "if (qc)" into the above. I also added the following
> comments about that we don't display the rowcount in the command
> completion tag output though we save it in qc. There is the discussion
> related to this topic, at [1]. Thought?
>
> +     * Save the rowcount so that pg_stat_statements can track the total number
> +     * of rows processed by REFRESH MATERIALIZED VIEW command. Note that we
> +     * still don't display the rowcount in the command completion tag output,
> +     * i.e., the display_rowcount flag of CMDTAG_REFRESH_MATERIALIZED_VIEW
> +     * command tag is left false in cmdtaglist.h. Otherwise, the change of
> +     * completion tag output might break applications using it.
>
> Attached is the updated version of the patch.
> Barring no objection, I will commit that.

Pushed. Thanks!

Regards,

--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2020-11-12 02:36:18 Re: Hybrid Hash/Nested Loop joins and caching results from subplans
Previous Message Craig Ringer 2020-11-12 02:25:23 Re: Add docs stub for recovery.conf